|
the problem is Me.ActiveControl.Name does not display any name that's only i asked why ? and i want to known which textbox is currently active
thank you
sathish
|
|
|
|
|
I showed you code to dymanically create textboxs, is that how these textbox's were created or were they created at design time? Controls created at design time are given a default name, however, controls created at runtime are not. When you create the textbox you need to set it's name property. This is one reason why 'Name' may not be returning anything.
|
|
|
|
|
My DataGrid has two columns: "ID" and "Name". I want to sort on the "Name" when the form is loaded. How can I do it? thanks.
|
|
|
|
|
hi,
use following statemet for sort the datagridview
dg1.Sort(columnName,System.ComponentModel.ListSortDirection.Ascending)
hope this helps
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
Hi, I bind a DataTable to a DataGrid. The DataGrid contains one column -- "Name". The DataTable has two columns -- "ID" and "Name". When the user selects a row in the DataGrid, how can I get the "ID" value from the DataTable?
Dim index As Integer = Me.dgdPersons.CurrentRowIndex
Dim oRow As DataRow = dsSearch.Person.Rows(index)
Dim ID As String = oRow("ID")
It works fine at the beginning, but if I click on the header of the "Name" column, the order of the rows is changed, and my code does not work then.
|
|
|
|
|
one way of doing this would be to give you're datagrid 2 columns and define the first column (ID) as index value or something like this (this will hide your column but you can still acces it from code)
another way would be to again make 2 columns but just make the width of the ID column 0
Hope this helps
|
|
|
|
|
Hi all,
I want be able to enable and disable navigation buttons when on the first or
last row of a DataGridView object.
I have a populated DataGridView and two buttons - "First Row" and "Previous Row"
If the user clicks "First Row", they are taken to the first row in the DataGridView via:
Private Sub btnFirstRecord_Click(...) <br />
' Move to first record in job list <br />
dgvMyRecords.CurrentCell = dgvMyRecords.Rows(0).Cells(0)<br />
End Sub
What I then want to to is disable the Prev Row button like this...
Private Sub dgvMyRecords_SelectionChanged(...)<br />
If dgvMyRecords.CurrentRow.Index = 0 Then <br />
btnPrevRow.Enabled = False<br />
Else <br />
btnPrevRow.Enabled = True <br />
End if <br />
End Sub
The problem is... this works if the user selects the first record using the mouse,
but not if the first record is selected through the code using CurrentCell.
If I click on the first row, SelectionChanged gets called AFTER the row gets changed.
If I set dgvMyRecords.CurrentCell to dgvMyRecords.Rows(0).Cells(0) (ie. select the first
row via code), SelectionChanged gets called, but BEFORE the row gets changed !?!?!?
Can anyone show me how to do this ?
cheers,
Matt.
|
|
|
|
|
Try using the DataGridView CellEnter event rather than the SelectionChanged event to toggle your navigation buttons.
|
|
|
|
|
Thanks Thomas... thats done the job nicely!
Still have issues with the SelectionChanged behaviour though, but you've given me a workaround...
cheers,
Matt.
|
|
|
|
|
A simple problem to solve I'd assume; I'm using MAPI to manipulate messaging. I have set up a profile in Outlook Express, and I can send email using my application. When I send to myself, it goes straight into my profile's inbox: Hotmail. However, When I use MAPIMessages1.MsgCount, it returns 0, as it reads from the default LOCAL folder. Any ideas on how to get my messages read from my new account?
|
|
|
|
|
why not use the system.net class. Alternatively, if you must use mapi, obviously you've set the custom folder or have it availabl;e in a variable, why not perform a manual message count with a loop or something.
Posted by The ANZAC : "WWBD, What Would Buffy Do?" : "I don't know man, she's stronger than me"
|
|
|
|
|
Thanks ANZAC, I think the problem lies in the way I've set my Outlook Express up as everything works well at work using Microsoft Outlook, but doesn't work with Express as I've got two folders: Local, and my default one.
|
|
|
|
|
i made a aql statement :
"select sum(fatrtot)reglz from reglz where fatrdate between '" + DateTimePicker1.Value + "'and'" + DateTimePicker2.Value + "'"<br />
and it's working well but there is sometimes gives me this number 10.233333333
how can i approximate it to nearest 10 or 100 plz tell me urgent
thanks
|
|
|
|
|
|
|
Then show the SQL statement and elaborate on the outcome
|
|
|
|
|
We have a SQL forum, you know.
The round function does obviously help you, because you can round off the number.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
How can i put a name for the datagride for the first row and then i want to put a spacifec value in the same coloum
examlpe
i want to put in the first row "vodafone" and under the word vodafone i want to put "20"
and then i was asking if there is to many number and i want to add them in one row as "total"and the total of them will be under this word "total"
thanks you all
|
|
|
|
|
Hi all:
Is there any way to make a particular item of the datagird unediatble ( ie a cell) ?
I'm using VB.NET 2003.
I'd appreciate your help in advance.
|
|
|
|
|
Hi, I was wondering if anyone could help me out w/ this. Ive been searching for days now and cannot find any information or help w/ this. I want to run specific programs within my vb.net application/form. I dont want the apps to launch separately from my form. I know theres a way to run them within the space of your vb.net form, because Ive seen it done before, but Im not sure what code/declaration to use.
Heres my code so far if it helps, Im using notepad just as an example:
Public Class Form1<br />
<br />
Private Sub AboutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AboutToolStripMenuItem.Click<br />
MsgBox("Created by.....")<br />
End Sub<br />
<br />
Private Sub NotepadToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NotepadToolStripMenuItem.Click<br />
Start.Process("Notepad.exe", AppWinStyle.NormalFocus)<br />
End Sub<br />
End Class
Any help or tips would be great. Thank you
|
|
|
|
|
y2ktheory wrote: I know theres a way to run them within the space of your vb.net form
There kind of isn't, what makes you think otherwise ? You may be able to embedd an app by making it a child window of your form, but it wouldn't be clean, or recommended.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Sorry...I guess im not exactly sure. Ive seen an app made w/ vb that could run notepad, paint, and a few other simple things within that space. Ive also been told it can be done by someone else he said
"Some Applications offer ActiveX Controls which can be used by other applications in their programs (Such as Windows Media Player, MS Word etc.)
I'm not aware of a Notepad ActiveX Control so you will have to use a large text-box in your form and write the menu yourself"
If I wanted to make a child window in my form, how would I tell the program to output/display in that window? Would I use something like txtGetText.... or showdialog..., im just now sure how to get it to stay within the form =/
|
|
|
|
|
y2ktheory wrote: Some Applications offer ActiveX Controls which can be used by other applications in their programs (Such as Windows Media Player, MS Word etc.)
I'm not aware of a Notepad ActiveX Control so you will have to use a large text-box in your form and write the menu yourself"
OK, what this guy said was - "some applications have special controls written, which allow you to create instances of applications within your app. However, Notepad does not do this, so you basically have to write the ( incredibly simple ) functionality yourself"
y2ktheory wrote: If I wanted to make a child window in my form, how would I tell the program to output/display in that window?
If you did this, the window would not be in any way under the control of your application. Following the other guys advice, is more sensible. I did say it's not a good thing to do.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
alright, thanks for your help, I appreciate it
|
|
|
|
|
glad to help
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|