Mick Dugan Posted March 13, 2005 Posted March 13, 2005 My application modifys the contents of a text box during the leave event. I'd like for the user to be able to overide the update by pressing the control key when he leaves the text box. Ideas... TIA Quote
coldfusion244 Posted March 13, 2005 Posted March 13, 2005 My application modifys the contents of a text box during the leave event. I'd like for the user to be able to overide the update by pressing the control key when he leaves the text box. Ideas... TIA GetKeyState sorry I don't know the .net version of this, people seem to frown upon API here, but this is my 2 cents. Quote -Sean
Leaders snarfblam Posted March 14, 2005 Leaders Posted March 14, 2005 Form.ModifierKeys What you need is the Shared property System.Windows.Forms.Form.ModifierKeys... If Not CBool(Form.ModifierKeys And Keys.Control) Then 'Perform validation or whatever here End If Use this property whenever you need to know if the user is holding shift, alt, or control. The example above would work if the user was holding shift and/or alt in addition to control. If you want it to work for only control, replace the "And" with an "=". Quote [sIGPIC]e[/sIGPIC]
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.