Je voudrais forcer la saisie dans la richTextBox en majuscule, mais je ne sais pas comment faire.
j'ai testé avec this.richTextBox2.Text.ToUpper(); mais cela ne change pas quand on saisie dans la textbox.
Version imprimable
Je voudrais forcer la saisie dans la richTextBox en majuscule, mais je ne sais pas comment faire.
j'ai testé avec this.richTextBox2.Text.ToUpper(); mais cela ne change pas quand on saisie dans la textbox.
Bonjour,
Si tu es en mode client winform ou wpf, tu peux intercepter l'event keydown et faire la transformation directement à ce moment.
Bonne continuation,
Comment faire pour intercepter l'event keydown ? stp
J'ai testé ça :
Mais le mot est écrit à l'envers.Code:
1
2
3
4
5
6
7 private void richTextBox2_TextChanged(object sender, EventArgs e) { this.richTextBox2.Text = this.richTextBox2.Text.ToUpper(); // this.richTextBox2.Text.ToUpper(); }
C'est bon avec le :
merciCode:
1
2
3
4
5
6
7 private void richTextBox2_TextChanged(object sender, EventArgs e) { this.richTextBox2.Text = this.richTextBox2.Text.ToUpper(); //this.richTextBox2.Text.ToUpper(); this.richTextBox2.SelectionStart = this.richTextBox2.Text.Length; }
Pour comprendre comment utiliser les event dans winform : http://www.techotopia.com/index.php/...arp_GUI_Events
Bonne continuation,