473,785 Members | 2,792 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CTRL Mouse Click

Is there a way to tell when a user, for example, Clicks the right mouse
button while also pressing the Ctrl Key?
Nov 20 '05 #1
2 13386
Kevin,

you can use the keydown and keyup events to toggle a variable that tracks
the current state of your ctrl key (e.control). then check your state
variable on the mousedown or click events.
Make sure your form's keypreview property is set to true.

Kirk Graves
"Kevin L" <no_spam@not_re al_email.com> wrote in message
news:u%******** ********@tk2msf tngp13.phx.gbl. ..
Is there a way to tell when a user, for example, Clicks the right mouse
button while also pressing the Ctrl Key?

Nov 20 '05 #2
"Kevin L" <no_spam@not_re al_email.com> scripsit:
Is there a way to tell when a user, for example, Clicks the right mouse
button while also pressing the Ctrl Key?


You can check in the 'Click' event if the key is pressed:

\\\
If ((Control.Modif ierKeys And Keys.Control) = Keys.Control Then
...
End If
///

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #3

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

Similar topics

3
7102
by: JMBollard | last post by:
I am working on a Swing application (Java 1.4 ) and I am having trouble implementing the following functionality: A JTextField that should not be part of focus traversal (should not be tabbed to), but the text can be selected and copied (Ctrl-C). This is a requirement across the whole application, which is hundreds of panels, so 'hard-coding' the tab order is not an option. TIA, John
0
1569
by: Kevin Nelson | last post by:
Has anyone experienced this before. I have a web project/application. One of the files in this application is a SQL Script file. When I use Ctrl+A to select all of the text of the file VS Net CRASHES horribly. The command window is raised and the "Error Reporting" application kicks in and VS Net is re started.
1
1613
by: Marek Mänd | last post by:
How to prevent selecting table cells with CTRL+mouse left click in Gecko based browsers?
1
2140
by: andrey.korolev | last post by:
How to disable opening link in new tab when I pressing left mouse button holding CTRL on it?
8
2950
by: MLH | last post by:
I use a mouse-down procedure to trap right mouse clicks and CTRL-Right mouse clicks. Running the procedure must put honey or some other sticky substance into my keyboard because subsequent RightMouseClicks run as if they were CTRL-RightMouseClicks I have to close the form and reopen it to clear this behavior. Then, after the first CTRL-RightMouseClick, it starts all over again.
14
3774
by: Amar | last post by:
Hi All, I am a newbie to PHP and have the task to create a page using PHP where in that page I need to disable all key operation as well as mouse operation even also the menu operation that means printscreen. I have only the java script code for mouse right click disable but that does not allow me to disable to do ctrl+c. So I need some help that can solve my task. Waiting for your replies. Thanks,
7
9585
by: =?Utf-8?B?QWxleCBLLg==?= | last post by:
Hi all When processing datagrid's MouseDown event, I need to know if Ctrl key is currently pressed. Is there any way to check this? It would help if I had keyUp and KeyDown events for Ctrl key ... Thank you
0
1460
by: johnmcpherson1 | last post by:
What's the best method for detecting a ctrl key being depressed simultaniously with a right mouse click in a datagrid in a vb application? I need to get row, field resolution. Regards, John
1
4935
by: Andrus | last post by:
I need to save font selected by user by Ctrl+MouseWheel in Winforms RichTextBox. I tried override below but this does not remember font: in this method Font.Size property seems to be always *initial* Font size when RichTextBox is created, *not* the font size set by ctrl+mouse wheel. How to find the font size set by Ctrl+Mouse wheel ?
0
9481
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10336
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10095
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8978
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6741
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5383
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5513
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4054
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2881
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.