I have VB.Net Applicaition. It has hundreds of textboxes with a variety of different length strings. Is there a way to automatically set the cursor postion to the beginning of the string as a user tabs thru them?
I have the code on the form that captures the Enter Key and converts it to a Tab key. I was thinking that in here, I could put in the code.... If texttbox Control then move cursor to the front of the string.
I am trying to avoid placing the code in each of the 100 textboxes on Enter property.
Protected Overrides Function ProcessCmdKey(ByRef msg As System.Windows.Forms.Message, ByVal keyData As System.Windows.Forms.Keys) As Boolean
If keyData = Keys.Enter Then
Dim ctl As Control = Me.ActiveControl
If Not (ctl Is Nothing) Then
If (TypeOf ctl Is TextBox) Or (TypeOf ctl Is CheckBox) Or (TypeOf ctl Is ComboBox) Then
Return MyBase.ProcessCmdKey(msg, keyData)