473,383 Members | 1,868 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,383 software developers and data experts.

Shift/Ctrl in the OnMouseUp Sub

I have created a UserControl and now I need to Override the OnMouseUp,
OnMouseDown, and OnMouseClick Subs but I also need to know if the Shift or
Ctrl key was pressed when the mouse action happened. How can I do that

Thanks
Fred
Nov 23 '05 #1
4 1773
Hi Fred,

You can use the ModifierKeys property of the Control base class.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com

"Fred" <no****@please.com> escribió en el mensaje
news:%2***************@TK2MSFTNGP11.phx.gbl...
I have created a UserControl and now I need to Override the OnMouseUp,
OnMouseDown, and OnMouseClick Subs but I also need to know if the Shift or
Ctrl key was pressed when the mouse action happened. How can I do that

Thanks
Fred

Nov 23 '05 #2
Try the Control.ModifierKeys property

/claes

"Fred" <no****@please.com> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
I have created a UserControl and now I need to Override the OnMouseUp,
OnMouseDown, and OnMouseClick Subs but I also need to know if the Shift or
Ctrl key was pressed when the mouse action happened. How can I do that

Thanks
Fred

Nov 23 '05 #3
"Fred" <no****@please.com> schrieb
I have created a UserControl and now I need to Override the
OnMouseUp, OnMouseDown, and OnMouseClick Subs but I also need to
know if the Shift or Ctrl key was pressed when the mouse action
happened. How can I do that

System.Windows.Forms.Control.ModifierKeys()

is a shared property you can evaluate in the procedure.
Armin
Nov 23 '05 #4
"Fred" <no****@please.com> schrieb:
I have created a UserControl and now I need to Override the OnMouseUp,
OnMouseDown, and OnMouseClick Subs but I also need to know if the Shift or
Ctrl key was pressed when the mouse action happened. How can I do that


\\\
If CBool(Control.ModifierKeys And Keys.Control) Then
...
End If
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 23 '05 #5

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

Similar topics

2
by: Chris Mullins | last post by:
I've seen a bunch of people post that they had troubles with this, but never saw anyone post a working solution. Shift F2 = F12 Ctrl Shift F2 = Ctrl - This seems to work well, as it jumps...
7
by: Paul Cooper | last post by:
Dear All, I am working on a piece of Javascript code that needs to detect a mouse-click, shift-click and control-click. The code is not my own - it is a part of a much larger suite of routines....
2
by: Guoqi Zheng | last post by:
Can some one tell me what is the chr value of Shift + Ctrl? a kind of soft return. an Enter, hard return is represented by chr(10) + chr(13), how about shift + ctrl? -- Kind regards Guoqi...
6
by: Morten Dahl | last post by:
The shortcuts won't work in my application. CTRL+Z CTRL+C CTRL+Y CTRL+X etc... In stead I must use the SHIFT key: CTRL+SHIFT+Z
7
by: yonatnl | last post by:
why In every time I pressing Ctrl + Shift + B, Visual Studio Compiles The solution? I Did not changed a thing in the Code. It was Ok 2 days a Go... and After getting Latest Version from the...
1
by: andmarti | last post by:
Anyone can help me getting the shift + tab key combination ? I tried with getch () but with no success. May be using the sys.stdin ?? Please, help would be very appreciated. -- Andrés M....
0
by: Yusuf Incekara | last post by:
I 've assigned a shortcut key for CTRL+SHIFT+1 key in my application. I can handle these keys in Form's keydown event. private void Form1_Load(object sender, EventArgs e) { this.KeyPreview =...
4
hsn
by: hsn | last post by:
hello everyone. i want to add to a string the windows ctrl button and the shift button. what i mean is, i want to store a string which has, lets say "cmd", i want to add to this string ctrl and...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

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.