473,569 Members | 2,770 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1783
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******** *******@TK2MSFT NGP11.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.Modifie rKeys property

/claes

"Fred" <no****@please. com> wrote in message
news:%2******** *******@TK2MSFT NGP11.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.M odifierKeys()

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.M odifierKeys 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
7278
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 between routines, and lets me get back to where I was. --
7
15480
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. The code as it stands does not work in Firefox, and I suspect that the task of feature detection (which currently depends on browser detection) can...
2
1313
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 Zheng guoqi AT meetholland dot com Http://www.meetholland.com
6
2624
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
4931
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 source safe The .. it compile everything each Time I press Ctrl Shift B
1
4638
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
2196
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 = true; } private void Form1_KeyDown(object sender, KeyEventArgs e) { label1.Text = e.Control.ToString() + "|" + e.Shift.ToString() + "|" +...
4
1912
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 shift, so it could be "cmd+ctrl+shift". this will help me to run the admin cmd in the windows vista OS "HOPEFULLY". best regards hsn
0
7694
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8118
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7666
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5504
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
936
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.