I have a textbox into which data is keyed.
I want to be able to have the keys entered set to upper case before they appear in the textbox.
I dont want the user to have to use the shift key. how can i do this
Can i do something inside the KeyDown or KeyPressed event that will convert them to uppercase

Force Uppercase
robbykfet
if (char.IsLower(e.KeyChar))
{
e.KeyChar = char.ToUpper(e.KeyChar);
}
amodir
or you could just make whatever the user types in, to uppercase after they press a continue button or something.
Dim theString as string = Me.theTextBox.Text.ToUpper()
Tramel
Not a good solution...
You're converting all the text to upper case. This makes caracter insertion impossible. The cursor won't move....
Keychar shound't be read-only!!!!
ashvik
e.KeyChar is readonly as passed from the base control. The following works in VB.NET:
sicikim
Add the following code into the textbox's keyup event
txtBTAddr1.Text = txtBTAddr1.Text.ToUpper
txtBTAddr1.Select(txtBTAddr1.Text.Length, 0)
Mohammad najdawi
I don't know, it might be a CF or a version problem...
Ramji
Private Sub txtBTAddr1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtBTAddr1.KeyPress
If Char.IsLower(e.KeyChar) Then
e.KeyChar = Char.ToUpper(e.KeyChar)
End If
End Sub
Bill at Rockford
Maybe you could use the OpenNETCF.Windows.Forms.TextBox2 control.
It has a property that configures the character casing that should be used:
textBox.CharacterCasing = CharacterCasing.Upper;
Greetings,
Peter Vrenken
zxber
<asp:TextBox ID="txtSurname" CssClass="TextBoxUpperCase" runat="server" ><asp:TextBox>