convert lawcase to upcase words
Post your questions regarding programming in C# in here.
8 posts
Page 1 of 1
Hi, i would like to know if there is a cod to convert latters from lawcase to upcase while typing any information in the application!!!
Under the TextChanged event of the textbox, try:
Code: Select all
TextBox1.Text.ToUpper()
That won't work ^^ Try this instead
Code: Select all
Dim Updt As Boolean = True
Private Sub TextBox1_TextChanged() Handles TextBox1.TextChanged
If Updt Then
Updt = False
TextBox1.Text = TextBox1.Text.ToUpper()
Updt = True
End If
End Sub
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!
![Image]()
![Image]()
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!

MrAksel wrote:That won't work ^^ Try this insteadIn that case, just use:Code: Select allDim Updt As Boolean = True Private Sub TextBox1_TextChanged() Handles TextBox1.TextChanged If Updt Then Updt = False TextBox1.Text = TextBox1.Text.ToUpper() Updt = True End If End Sub
Code: Select all
I don't see a need for the 'Updt" variable.TextBox1.Text = TextBox1.Text.ToUpper()
The Boolean Updt will always be True, so, like Reboh said, there is no need for the If statement.
We shall let the revolution begin.. the revolution for freedom, freedom against censorship. We shall fight in the fields and in the streets, we shall fight in the hills; we shall never surrender
GoodGuy17 wrote:When you useMrAksel wrote:That won't work ^^ Try this insteadIn that case, just use:Code: Select allDim Updt As Boolean = True Private Sub TextBox1_TextChanged() Handles TextBox1.TextChanged If Updt Then Updt = False TextBox1.Text = TextBox1.Text.ToUpper() Updt = True End If End Sub
Code: Select allI don't see a need for the 'Updt" variable.TextBox1.Text = TextBox1.Text.ToUpper()
Code: Select all
TextBox1_TextChanged will be called again, and again, and again in an unbreakable loop. The Updt variable will prevent this loop.
TextBox1.Text = TextBox1.Text.ToUpper()
Codex wrote:The Boolean Updt will always be True, so, like Reboh said, there is no need for the If statement.It will not always be True. It is set to false to prevent the update caused by
Code: Select all
And set to True again afterwards.TextBox1.Text = TextBox1.Text.ToUpper()
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!
![Image]()
![Image]()
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!

TextBox1.Text = TextBox1.Text.ToUpper()
this code worked but when i´m writting the cursor goes back of the word, i mean the words come from right to the left.
this code worked but when i´m writting the cursor goes back of the word, i mean the words come from right to the left.
Code: Select all
Dim Updt As Boolean = True
Private Sub TextBox1_TextChanged() Handles TextBox1.TextChanged
If Updt Then
Dim Index As Integer = TextBox1.SelectionStart
Updt = False
TextBox1.Text = TextBox1.Text.ToUpper()
Updt = True
TextBox1.SelectionStart = Index
End If
End Sub
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!
![Image]()
![Image]()
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!

8 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023