473,788 Members | 2,759 Online
Bytes | Software Development & Data Engineering Community
+ 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_KeyDo wn(ByVal sender As Object, ByVal e As
System.Windows. Forms.KeyEventA rgs) Handles MyBase.KeyDown

If e.KeyCode = Keys.LWin Then

SendKeys.Send(" {TAB}")
Application.DoE vents()

ElseIf e.KeyCode = Keys.RWin Then

Application.DoE vents()

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 1422

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

Similar topics

18
4932
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 help. I have seen some example that looks at the characters entered in an input field to determine if the caps lock is on, but I was wondering if something is possible that is a bit more immediate to report the caps
4
6658
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 tell me why (the hell)it happens that way.
7
2704
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
6242
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 of message up front when they load records, than being told "updating failed" after they spend all the time entering their data. So here I am spending a lot of time trying to find a good
1
983
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 first. Then he/she can use OS as usual. Any suggestions/ideas/links would be great to me. Thanks ! Fei
1
3006
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 Lock on, the arrow keys return an e.KeyCode of 'None'. With Num Lock off, the program fails to see them, BUT, some of my programs register them correctly???!! Is this a Win XP driver problem, a hardware fault, or a .NET framework reinstall job?
5
2683
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 void incre(){ if(x < 20) x++; } } class Form1: WinForm{
5
4248
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
3407
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 ascii code. Is there any way to lock the items in the combo box?
0
9656
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10177
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9969
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8995
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
6750
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
5403
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
5538
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4074
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
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.