Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
KeyPress question
Message
 
À
13/07/2005 23:38:49
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01032486
Message ID:
01032594
Vues:
24
Hilmar,
You wanted to know is ctrl, shift, alt, etc were pressed. Try the following code:
private void textBox2_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
	MessageBox.Show(e.Modifiers.ToString());
}
Einar
>>Hilmar,
>>There was a lot of questions in your post. ...
>
>Yes, indeed. And I will still have more questions...
>
>>You can handle the backspace like this:
>>
>>e.KeyChar == '\b'
>>//or
>>e.KeyChar == (char)System.Windows.Forms.Keys.Back
>>
>
>Thanks, that works. But that immediately reminds me of another question: What is the usual way of checking, for example, for Ctrl or Alt? Say, I want to carry out a special action if the user presses Ctrl-X or something.
>
>>Arrows and tab and delete and probably some other keys are not even captured by the KeyPressed event. I am not 100% sure why. Hopefully someone else knows why
>
>Well, the fact that they are not checked sure simplifies the validation. Perhaps Microsoft wanted to more or less impose, or just simplify programming for, a standard interface. "More or less" because the might be workarounds.
>
>>South America use comma as the decimal separator like in Europe right. That has to do with the culture setting(so on my computer the period is the decimal symbol)
>
>Yes, that is the way my Control Panel is set up.
Semper ubi sub ubi.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform