|
-
Apr 25th, 2009, 02:53 AM
#2
Re: Remove Focus From Listbox
When you say they all retain the focus - do you mean they all show their selections? That is different from focus - a listbox will retain its selection whether focussed or not. Only one control can have the focus at any one time.
The best approach depends on what you are trying to achieve, if you are saying that the user must only be able to select one item from the whole form then an approach like the one you describe above would work, but you may need to call the "Focus" method of the listbox clicked after deselecting the entries in the other listboxes.
If all you want to do is suppress the display of the selected item in the listboxes that aren't selected, you might want to consider switching from using listboxes to listview controls instead. Listviews have a property "HideSelection" which when true (which is the default) hides the selection marker when the control loses the focus.
Last edited by keystone_paul; Apr 25th, 2009 at 03:18 AM.
Tags for this Thread
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
|