undesirable side effects of lostfocus event

delikedi

Registered User.
Local time
Today, 01:04
Joined
Apr 4, 2012
Messages
87
On a form with many listboxes, I got annoyed with the way the form looked (it looks like a zebra) after selections have been made in most of the listboxes. Any selection in the listbox causes that line to be black, and the only way back from that is programmatically un-selecting the line.

So I wrote a simple piece of code to the listboxes' lostfocus event that unselects the line in the listbox. However now whenever I click on another control, thus shifting the focus, the first click almost never counts. I have to click again for the focus to move. As if the first click is consumed by the lostfocus event of the relevant listbox.

I had to remove all such code but that's not exactly ideal for me. What kind of operations is the lostfocus event good for anyway?
 
IMO the lost focus event is good for almost nothing, particularly nothing related to data. Maybe you can use it for changing the look of your user interface or to display custom or context sensitive information about an object.
 

Users who are viewing this thread

Back
Top Bottom