M
moondaddy
I'm writing an app in vb.net 1.1 and all of my forms use a combo box to
navigate to different records. when the form loads I databind a dataset
table to the combo box. However, the form is opening up to a blank - new
record and I don't want any text showing in the text area of the combo box.
I want the combo box's text area to show nothing until the user selects
something from its list. Below is the code used to populate the combo and
some remmed lines where it tried to force the combo to have nothing
selected. Can someone please advise me on how to do this?
Thanks!
Private Sub cmbGoToRowSource(ByRef tb As
wsContactMangaer.dsContactMngr.tbAddressListByCustDataTable)
Try
Cursor.Current = System.Windows.Forms.Cursors.WaitCursor
Me.cmbGoTo.DataSource = tb
Me.cmbGoTo.DisplayMember = "Name"
Me.cmbGoTo.ValueMember = "ID"
'Me.cmbGoTo.SelectedIndex = -1 'These 3 lines still left text in
the combo box text area
'Me.cmbGoTo.Text = ""
'Me.cmbGoTo.SelectedText = ""
Catch ex As Exception
ErrLog(ex)
Finally
Cursor.Current = System.Windows.Forms.Cursors.Default
End Try
End Sub
navigate to different records. when the form loads I databind a dataset
table to the combo box. However, the form is opening up to a blank - new
record and I don't want any text showing in the text area of the combo box.
I want the combo box's text area to show nothing until the user selects
something from its list. Below is the code used to populate the combo and
some remmed lines where it tried to force the combo to have nothing
selected. Can someone please advise me on how to do this?
Thanks!
Private Sub cmbGoToRowSource(ByRef tb As
wsContactMangaer.dsContactMngr.tbAddressListByCustDataTable)
Try
Cursor.Current = System.Windows.Forms.Cursors.WaitCursor
Me.cmbGoTo.DataSource = tb
Me.cmbGoTo.DisplayMember = "Name"
Me.cmbGoTo.ValueMember = "ID"
'Me.cmbGoTo.SelectedIndex = -1 'These 3 lines still left text in
the combo box text area
'Me.cmbGoTo.Text = ""
'Me.cmbGoTo.SelectedText = ""
Catch ex As Exception
ErrLog(ex)
Finally
Cursor.Current = System.Windows.Forms.Cursors.Default
End Try
End Sub