Re: Allow entering uppercase only
- From: "Oenone" <oenone@xxxxxxxxxxx>
- Date: Sun, 03 Jul 2005 11:37:56 GMT
Rob wrote:
> Is there an easy way to ensure that only Upper case characters are
> entered into a tex box ?
You could try this:
\\\
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
TextBox1.SelectedText = UCase(e.KeyChar)
e.Handled = True
End Sub
///
That seems to work fine. Note that text that the user pastes in will not be
affected by this so you probably want to follow Cor's recommendation too
when the user clicks the OK button on your form.
--
(O) e n o n e
.
- Follow-Ups:
- Re: Allow entering uppercase only
- From: Supra
- Re: Allow entering uppercase only
- References:
- Allow entering uppercase only
- From: Rob
- Allow entering uppercase only
- Prev by Date: Re: [Assembly] gives "Type 'Assembly' not defined" error
- Next by Date: Re: WebService & Dataset's
- Previous by thread: Re: Allow entering uppercase only
- Next by thread: Re: Allow entering uppercase only
- Index(es):