473,387 Members | 3,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Sticking Mouse btn issues

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: ?????
Nov 20 '05 #1
1 1487
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: ?????

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jason | last post by:
I'm trying to implement some pretty basic behavior in c#/.net 1.1 Forms but can't seem to find all the requisite pieces. When a user clicks on the background of the form, I want the app to start...
3
by: jcrouse | last post by:
I have created a form designer type application (with a lot of you peoples helpJ). It has label controls that are draggable at runtime. The user is also allowed to change some properties such as...
0
by: Lou | last post by:
Dear all, I have two questions and need to get some hints from u. :0) 1. Editor with the syntax functionality. In my ongoing editor, when the user types the word, e.g. "ABC", the word "ABC"...
4
by: atn2002 | last post by:
How can I track the mouse coordinates outside the active window? No one can tell me its not possible because Google Spreadsheets and EditGrid both do it. When you drag down to select cells these...
1
by: =?Utf-8?B?bGpsZXZlbmQy?= | last post by:
I've noticed that if you click on a Windows.Forms.ToolStripButton then a MouseLeave event will not occur until the button is released. ToolStripMenuItems on the other hand will raise a MouseLeave...
2
by: markszlazak | last post by:
In the following script, a control displays (black box) in each table cell once you mouse over the cell. Mouse down on the control to change the mode of the table. Drag the mouse over cells in the...
22
by: schneider | last post by:
I need to hook the system mouse down event. I'm trying to replicate how a context menu hides when the mouse clicks outside of the control. Thanks, Schneider
1
by: =?Utf-8?B?YWNlLXBva2Vy?= | last post by:
I have been using a MS Laser Mouse 8000 with Vista for some time now with no problems other than very occasionally the mouse is not detected during boot and I have had to re-start. The problem I...
3
by: West55 | last post by:
I have an Access 2003 database I developed for one of my departments. I have been using Stephen Lebans' MouseWheelOnOff system to turn off the Mouse Wheel without any issues since I developed the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.