|
-
Mar 27th, 2000, 10:10 AM
#1
Thread Starter
Member
I know that the on Click event should activate no matter where I click in the listbox. However, it is only working when I click on a added item. Is there any reason for this, a property maybe?
-
Mar 27th, 2000, 10:18 AM
#2
Hyperactive Member
Well thats not "technically" true.
The click event is triggered when you click on an "ITEM" inside a list box... not anywhere in the list box itself.
The reason for this is simple. The PURPOSE of the control is to select from a list of options. As a result clicking in the empty space where there are NO options is effectively doing NOTHING as far as the control is concerned.
You have to think of the area of effect that comes with controls. With a command button the click event has an area of effect that covers the WHOLE button... with a check box the area of effect covers ONLY the little box and NOT the text next to it... the same applies to the listbox. The area of effect of the list box ONLY covers the clicking over an item that is contained in that list.
What you might want to do is have a read up on the MouseDown and MouseUp events that go with list box. This will be triggered if you start to press the mouse button and it doesn't CARE where you are in that box but you do have to manually check to make sure you are not interfering with it performing its normal duty of highlighting the selected item.
Oh and also make sure that you only perform something upon the MouseUp and not the MouseDown because you CAN hold the mouse down while in that form and then DRAG the mouse out before releasing the button... in that case you dont want your listbox running away to do something.
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
|