|
-
Jun 25th, 2000, 02:49 PM
#1
Hi guys,
This has been doing my head in all afternoon. I have a listbox on my form which reads it's data from an Access DB. I also have a normal textbox on my form.
If you select an item in the listbox it becomes highlighted, no problems so far. But, if you then click on the textbox the item un-selects itself. I cannot understand why. I have tried as a test, putting another listbox on the form and filled it's contents at design-time with numbers 1,2,3 etc,,. When this is run you can select an item in the test listbox, click on the textbox and it is still selected.
Any ideas why the first listbox keeps unselecting itself? Is it because the data in it is read from a DB ?
Cheers
-
Jun 25th, 2000, 06:28 PM
#2
Addicted Member
Are you sure it's deselecting itself, or just the ListBox losing focus when you click the TextBox?
Visual Basic 6 Enterprise Edition + SP4
-
Jun 25th, 2000, 06:37 PM
#3
When I say deselect itself, I mean that the item you originally selected in the listbox is not Highlighted as soon as you click on the textbox. It is really wierd because the Test listbox I put on the form does not do this !
Anyway, I have now worked out how to get around the problem, I can make a note of the ListIndex property and when the listbox loses focus just say lstListBox.Selected(ListIndex) = True
But why it does this puzzles me.
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
|