Hi guys, I'm stucked at (as it seems to me) a very strange problem. I have a listview on my form to which a list of users is populated from mssql db. In the same table but different column I have user_id. I have a textbox and a textbox_keydown control to it.
When user enters a ID number in textbox, on keydown event in listview item is selected.
Listview MUST be locked because users must not change the selection-just view the selected item.
Now, on keydown event the item is 100% selected (msgbox gives me the selected item), but (here comes the problem) it is not visible/highlighted. At least not on any WinXP machine that I've tried. On several Win7 PCs works great, but on WinXP PC item is not visible.
this is parts of my code that I think is relavant:
Private Sub TextBox9_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox9.KeyDown ListView1.Enabled = False 'data reader reads from mssql Me.ListView1.FindItemWithText(reader.Item("USER")).Selected = True Me.ListView1.FindItemWithText(reader.Item("USER")).EnsureVisible() ListView1.Select() End Sub
On win7 machine, I get a grey background in listview (ofcourse-because is locked) and a nice blue color background for selected item. But in winXP the listview background is also gray, and selected item seems to be also because I can't seem to see it.
I'm would really appreciate some help guys.