The Article below will demonstrate the use of the KeyDown events for you to enable shortcut keys on a TextBox
The Following Code Has to be written in the KeyDown Event
Private Sub TextBox1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
If e.Control Then
If e.KeyCode = Keys.U Then
TextBox1.Text = TextBox1.Text.ToUpper()
End If
If e.KeyCode = Keys.L Then
TextBox1.Text = TextBox1.Text.ToLower()
End If
If e.KeyCode = Keys.R Then
Dim st As String
For Each c As Char In TextBox1.Text.Reverse() 'Using the Extension Method of LINQ only works in .NET 3.5
st &= c.ToString()
Next
TextBox1.Text = st
End If
If e.KeyCode = Keys.B Then
TextBox1.Font = New Font(TextBox1.Font, FontStyle.Bold)
End If
If e.KeyCode = Keys.I Then
TextBox1.Font = New Font(TextBox1.Font, FontStyle.Italic)
End If
End If
End Sub
You can add as many Shortcut Keys you want
For ALT key combinations
If e.Alt Then ......
For Shift Key Combinations
If e.Shift Then ......
Hope this Article is Usefull...
Regards
Hefin Dsouza