C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » General »

Keyboard CapsLock On/OFF


Posted Date: 23 Aug 2008    Resource Type: Articles    Category: General
Author: Ramesh NarayanMember Level: Gold    
Rating: 1 out of 5Points: 7



This article shows how to check it out wheather the Keyboard CapsLock,NumLock,ScrollLock On/OFF and also toggle the caps lock


private void Form1_Load(object sender, EventArgs e)
{
if (Control.IsKeyLocked(Keys.CapsLock))
{
listBox1.Items.Add("CapsLock ON");

}
else
{
listBox1.Items.Add("CapsLock OFF");

}

if (Control.IsKeyLocked(Keys.NumLock))
{
listBox1.Items.Add("NumLock ON");
}
else
{
listBox1.Items.Add("NumLock OFF");
}

if (Control.IsKeyLocked(Keys.Scroll))
{
listBox1.Items.Add("ScrollLock ON");
}
else
{
listBox1.Items.Add("ScrollLock OFF");
}

}

private void button1_Click(object sender, EventArgs e)
{
keybd_event(0x14, 0x45, KEYEVENTF_EXTENDEDKEY, (UIntPtr)0);
keybd_event(0x14, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP,
(UIntPtr)0);
}


For more details, visit Snippet, Keylock,Keyboard lock




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Authenticating usernames and passwords from database
Previous Resource: The effect of mobile phone radiation
Return to Discussion Resource Index
Post New Resource
Category: General


Post resources and earn money!
 
Related Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use