|
-
August 17th, 2012, 03:08 PM
#1
Combobox Event Handlers
I have a combobox and a txtbox. Both are databound. Choosing a value in the combobox initiates the txtbox fill. Right now my event handle for this event is "onclick" but I would like to change the event to something that would initiate the txtbox fill "onmouseover". I tried "mouseHover" but that does not work. Any ideas?
Code:
Region "Fill Description Box"
Private Sub cboPartNumber_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboPartNumber.MouseHover
Dim UdtConn As New SqlConnection(sBoMConnectionString)
'Selects a part numbers corresponding description'
Using UdtConn
UdtConn.Open()
Dim udtSqlCmd As New SqlCommand("SELECT Part_Desc FROM dbo.Part WHERE Part_Nbr = @Part_Number", UdtConn)
udtSqlCmd.Parameters.AddWithValue("@Part_Number", cboPartNumber.Text)
Dim myReader As SqlDataReader = udtSqlCmd.ExecuteReader
If myReader.HasRows Then
Do While myReader.Read
txtPartPickDescription.Text = myReader.GetValue(0)
Loop
End If
UdtConn.Close()
End Using
End Sub
#End Region
Thank you for any help you may offer.
-
August 18th, 2012, 02:02 AM
#2
Re: Combobox Event Handlers
Perhaps this article may be of help :
Extending the ComboBox with C#
http://www.codeguru.com/csharp/cshar...cle.php/c15261
It is in C# though, but it covers more advanced topics about the ComboBox.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|