473,472 Members | 2,208 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Lock the keyboard

Hi all,

There are hundreds of posts on usenet to do something similar to what I
want but either they do not work or are no good for me. Here is my
problem:

I have a form which covers the entire window. Therefore the start
button is not available for clicking. However, you can activate the
button using the windows key on the keyboard. What I want to do is
entirely lock the keyboard so that any input is ignored until i say so.

I tried trapping the event with the below code but it is just ignored,
consequently the user can open the start menu.

Private Sub Form1Trap_KeyDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown

If e.KeyCode = Keys.LWin Then

SendKeys.Send("{TAB}")
Application.DoEvents()

ElseIf e.KeyCode = Keys.RWin Then

Application.DoEvents()

End If

End Sub

It may well be that my code is wrong or that I am doing something
wrong. I known that there is the BlockInput command but that blocks
the mouse as well whereas I need the user to use the mouse to interact
with the form.

Any ideas on how to block the keyboard until I say not to? I am using
VB.NET 2003. I don't mind if it is not managed code (as I suspect that
it won't be).

Thanks,
Hugh

Feb 23 '06 #1
0 1394

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

Similar topics

18
by: Robert | last post by:
Hi! I was wondering if the was any way to determine the state of the caps lock key, on or off. Of course I can capture the key events and see whether the caps lock is pressed, but that does not...
4
by: Peter D | last post by:
I have a second hand bar code reader (keyboard wedge) en i can read the bar codes but after every scan he turns my caps lock on. (GRRRRRR). I search a code to turn my caps lock off or can anyone...
7
by: jjmraz | last post by:
Hi, How can I lock down the desktop stopping end user from getting to desktop when inside my app until they quit app? Also how can I start another app from my app? Thanks, JJ
4
by: feng | last post by:
Hi, I know ADO.Net recommand using disconnected update (optimistic concurrency) for good reasons, but it's just not an option for us. 99% of our clients would rather seeing "record locked" kind...
1
by: Fei | last post by:
Hi, Is here a way to Lock OS ? Suppose I write an application. However, I don't want user to use Alt-Tab or any key such as Win key to do anything else. The user has to shut down application...
1
by: Paul Nathan | last post by:
Further to my post about keyboard problems, I have discovered that Num Lock seems to change the e.keycode for the arrow keys and the 9 above them excluding scroll lock and pause-break. With Num...
5
by: fei.liu | last post by:
Hello, in the application I am developing, I am having trouble to synchronize event triggered actions using 'lock(ob){...};' technique. Here is a outline of my code: class C{ int x = 0; public...
5
by: Muhammad Ahsin Saleem | last post by:
Hi I want to Turn Caps Lock off when I start my Application If Caps Lock option is on. Can anybody help me. Kindly do tell me about it.
3
by: bluethunder | last post by:
Hello to all of you guys. I have a problem in the system that i made. How will i going to prevent the deleting of item in the combo box w/out disabling the backspace and delete key in keyboard using...
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
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,...
0
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...
1
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...
0
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...
0
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,...
0
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...
0
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 ...

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.