Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted
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.

-Sean
  • Leaders
Posted

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 "=".

[sIGPIC]e[/sIGPIC]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...