Detecting Keypress Outside The Form?
Mar 17, 2009I need to find out how to detect keypress's outside of my form
View 1 RepliesI need to find out how to detect keypress's outside of my form
View 1 RepliesI have two issues. The first is that I want to make a textbox scrolling similar to how credits scroll. I don't want it to move on the form, just to scrolling the text down a line/pixel. I thought I could do it with the "Lines" element, but I'm not exactly sure how to execute it.
The other problem is with my flash screen. Right now I have it set so when a button is click, it goes onto the main form. I don't want to use the button but rather have it so if Enter is pressed at any time, it'll go to the main form. All the solutions I've tried to use involve the "e.Keycode" code, but for some reason its unavailable.
How do I detect a ctrl+tab keypress?
Reason for asking: I want to stop a user from changing tabs in a tab control.
I want to be able to detect when the user presses F10 or Ctrl+F10 outside of my program, and upon receiving the key press, it will send text to whatever they currently have selected (e.g. a text box). How can this be accomplished in the simplest way?
View 3 RepliesIf my window is hidden or out of focus, how do I detect a keypress? The idea is that it just sits in the tray as an icon until a key combination is pressed and then it pops back up again.
View 2 RepliesI am creating an application that creates scripts to move a mouse and to click where a user wishes to via pre-programmed code and to also press keys where required. I have the code to move a mouse and to manually click anywhere. What I am after is to detect when a mouse button is pressed and dragged and when keys are pressed.
I see that there is the following
MouseButtons.ToString
To detect when a mouse button is pressed, and have it looping in a timer. Is there a better way to do this? I would rather not use a timer. And is there a similar routine to detect which keys are pressed?
I'm trying to detect the Printscreen keypress with the use of a timer. I can't useform1_keyup/down as the focus isn't always on the form.
View 4 Repliesi want to be able to load form2 by pressing the right mouse button.
here's what i have so far:
Private Sub Form1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress
If vbKeyRButton = True Then
[Code].....
e.KeyCode is giving me an error.
I want to create a program that gets if the user has pressed a code, for example F8, but without the user having to have focus on the form. I want the program to start hidden, and while the user works normally (say browses the internet (Go Google Chrome)), he just presses F8 and the form shows up. So I ask, is there any way to get key presses outside the form? [code]
View 2 RepliesPrivate Sub Form1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress
If vbKeyRButton = True Then
[code].....
Dim en As Boolean = False
Private Sub ArrowKey(ByVal sender As Object, ByVal e As KeyEventArgs) Handles Me.KeyDown
If en = True Then
[code]....
I'm using VB.NET (2008) and .NET framework 3.5. In my application I've got an on screen button that, when pressed, sends "00" as the characters [via SendKeys.Send("00")]. I also have a keyboard that has a '00' key that sends "00", two zeros, when pressed. I'm picking up the keypress using the form's KeyDown event - it fires twice, once for each "0" and works whether the on-screen or keyboard '00' is pressed. There's also a singe '0' on-screen button and key on the keyboard that sends "0".
I want to be able to treat the "00" as a single event. I.E. in the KeyDown handler, if the character is a single zero "0", I would like to check the next character to see if it is also a zero "0". If it is then I can handle it appropriately, but also need to remove it (from the keyboard buffer?) so that it doesn't fire the second KeyDown event. If it's not a zero then it should be left to fire the next event in the normal fashion.
i would like my form to dissappear when the user clicks outside the form in vb.net. how do i do this?
View 1 Replieshow to detect when the "DEL" key has been pressed in a VB 2008 windows form?
View 5 RepliesIn a project I'm working on, I have 3 separate mazes, a Splash Screen, and a Module for my global variable(gWin, to detect wins on the mazes). When you finish a maze, I'd like to get it so that it does not allow you to go back and redo a maze, to prevent cheating as I want a final screen to appear when they complete all 3 of the mazes. Is there a way that I can make a variable or something to be able to check if a maze was already completed then cause that maze to have it's .Enabled property set to false?
View 8 RepliesI am new to vb.net and what I want to do is change the bg color if my form is active.
I have tried searches and try and fail but I cant figure it out
how can i detect mouseclick outside the form (for example desktop)
View 5 Repliesmove the focus to the next TextBox (don't worry about the Case 38, 58 etc too much I).
My Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'(Unrelated code here)
AddHandler Form1.KeyDown, AddressOf EnterkeyHandler 'Would like to understand this better
[code]....
Is there any way to detect the area under a form window. e.g I want to create a grid and use what's in that grid to match patterns.orIs there any way to take a screenshot of the area under a form?
I have been searching all over for something that will do this and the only thing I managed to find was [URL]..I do not however want it for this application (If I really wanted to cheat at a game I would buy the software). But this is a perfect example of the pattern matching I wish to achieve.Edit: OK scratch that... I have managed to take a csreenshot of the region under a form, now has anyone any experience in pattern matching images?
I can detect the type of mouse cursor (normal, hand etc) inside the form but i need to detect it when the cursor is outside the form.
View 2 RepliesI have a loop that says this...
Do
If e.KeyCode = Keys.F4 Then
Exit Sub
Else
[code]....
My problem here is that what the loop does is click on another program, thus taking the focus off of mine, how would i be able to make my app see if I press the key even if the form isn't in focus?
I am creating a user control where when a user clicks a button a popup window will show up with information. The popup window is driven by a toolStripDropDown so when it shows up it does 2 things
Does not move the other controls on the form around but displays over them That it can show the details outside the bounds of the user control itself without having to reserve the space ahead of time
Here is some code
Public Class Popup
Private treeViewHost As ToolStripControlHost
Private Shadows dropDown As ToolStripDropDown
[Code].....
Now my issue is as the form moves or resizes the Tooldropdown does not move relative. I understand that. When I try to capture the move event of the user control that event does not fire when the entire form moves. There has to be something I can capture because the controls in the container of the form move relative, what drives that? I tried wndproc but nothing fires during form move unless the form is repainted.
What's the code to make a form keypress event for escape? I know that "If e.KeyChar = Chr(13) Then" is for the ENTER button. What's the code for the ESCAPE button?
View 22 RepliesI have a simple question regarding the KeyPress event. I'm trying to make it to where my TextBox on my form can only accept numbers 0-9, backspace and '.' /without quotes. I've successfully got it to accept numbers 0-9, accept backspace, I'm just wondering - what line do I add so that it can accept periods as well?
Here's my
Private Sub TextBox_KeyPress(ByVal sender As Object, ByVal e _
As System.Windows.Forms.KeyPressEventArgs) Handles _
TextBox.KeyPress
[CODE]...
I want to make an auto log off feature, I want to detect if there is any user input, and if there isn't the user will be automatically logged off. So I want to know how to detect mouse wheel events when the form doesn't have focus.
View 1 Replieshow to get the ascii of a key press on a timer.
View 6 RepliesI am trying to write a program that dims the brightness on my laptop. I have been unable to find the correct code, so I am trying to get it to press 'Fn & Down' on form load. The problem is I cannot find 'Fn' in the e.KeyPress I set up a small program that alerts me of the key pressed and pressing 'Fn' does not give and alert. Pressing 'Fn & Down' Gives a keycode of "None" Is there some way I can register the 'Fn' key in vb.net?
View 2 RepliesI have written a login. Now I want to do this (press return to login):
[Code]...
It does not work. At this time it works only with a button.
Before anyone tries to close this thread thinking this is for malicous purposes, let me tell you that it's not. What i'm working on is an application to save screenshots to files as soon as the 'Print Screen' key is pressed, as Jpegs or what ever. What i want to do is be able to minimize the application and I still want the application pick up on any 'Print Screen' presses, and save the screenshots. I've tried using the KeyPress event, but I soon realized that it only worked when the application had focus. I plan on using it to save screenshots every time I press 'Print Screen'
View 2 RepliesIs there a way to do something when the left mouse curs is down. ive tried:
If apimouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0) Then
do things
end
i have this on a timer so i want as long as mouse is down do this...yess i have declered mouse event but when i try it ignore apmouse event and do the things even if not cursor is down If you donīt Believe in it, Then it Doesnīt Exist!