I have visual studio 2010.
I have a ListBox and a ComboBox, if you select a item from the listbox and after you click the combobox, the listbox refresh. It's like clearing the combobox and adding the items again.
If you open a new project, add a ListBox, add some items to the ListBox, add a ComboBox, run the project, select one item from the ListBox, click the ComboBox and the ListBox for some reason refreshes.
Anyone knows why it happens?
If some can try it, to see if it is an issue with VB, or some setting in my program.
Found this answer: Listbox flicker when combo box drops down
It suggests using this version of the ListBox (I translated it from c#) and it worked for me:
Public Class MyListBox
Inherits ListBox
Private WM_KILLFOCUS As Integer = &H8
Protected Overrides Sub WndProc(ByRef m As Message)
If m.Msg <> WM_KILLFOCUS Then
MyBase.WndProc(m)
End If
End Sub
End Class
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With