VB.NET Winforms Application… When a user starts typing in the search box of the application it automatically populates the name list dropdown box with the valid results and sets the droppeddown value to true… Everything is working fine except the fact that the user is forced to select a value from the name list or press the esc key because without doing so the mouse cursor just disappears and you have to move the mouse all the way outside the application for it to come back and it will only do so while outside the applicaiton.. Below is the code that I am using for this and it should be noted that I am using the droppeddown value else where in the application and none of those instances have an issue its only this one… Any ideas???
Private Sub u_lastName_Box_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles u_lastName_Box.TextChanged
u_nameLook_Box.Items.Clear()
Dim TenList As New List(Of tenant)
Dim x As List(Of tenant) = db.tenants.Where(Function(f) f.last_name.Contains(u_lastName_Box.Text) AndAlso f.propertyId = selectedProperty).OrderBy(Function(f) f.last_name).ToList
For Each _ten In x
Dim c = _ten
u_nameLook_Box.Items.Add(Convert.ToString(c.Occupantid) + " -- " + c.last_name + "," + c.first_name)
Next
RemoveHandler u_nameLook_Box.DropDown, AddressOf u_nameLook_Box_DropDown
u_nameLook_Box.DroppedDown = True
AddHandler u_nameLook_Box.DropDown, AddressOf u_nameLook_Box_DropDown
End Sub
I actually fixed this issue just now after thinking about it for the night.. I tried the cursor.show with no dice… I thought a little more on that and decided to set the cursor style prior to the cursor.show and it works now… My updated code is below… There is some question as to how or why the cursor style and visibilty got changed in the first place…