Well doing a loop isn't the right way in event programming.
set a varible in MouseDown event
if e.button=leftbutton 'something like this; don' thave IDE open now.
then set a module level boolean variable
then in MouseUp or MouseButtonUp (can't remember which)...
see if e.button=leftbutton and if so clear the boolean and do whatever you
are to do when mouse is released.
at other times just check to see if boolean is set and do whatever....
probably you want this in the mousemove event if you are drawing
something....depends on your app...
HTH,
Shane
"jamie" <an*******@discussions.microsoft.com> wrote in message
news:c2****************************@phx.gbl...
hi.
I feel kinda stupid for asking this q, but here it goes:
When I mouse click a control, I want it to do a loop until
the mouse button is no longer held down. If I use
mybase.button then my loop never ends.
How do I read the mouse button directly?
Incorrect way:
while mybase.button = mousebuttons.left
'do something here
end while
Correct way: ?????