netnewb2002
Newcomer
Hello,
I need some help with .NET for Visual Basic. Probably is extremely easy for you pros, but it's sure giving me a head ache.
I have a textbox, named txtinput.text and a numpad, named nud1.value.
At runtime text will be inputed into txtinput, and the numpad: Whether clicked up or down will display the left letters, center letters, and right letters, of the string.
I've have figured out how to get the left and the right side to work properly, but for the center, I have no clue.
txtleft.text 'displays the left side of the string
txtcenter.text 'displays the center of the string
txtright.text 'displays the right side of the string
This is my code for the numpad. No idea on how to get the center of the string to display correctly, any help? I deleted the mid function I tried, cause at run time it would start way out at the right end of the string, and go backwards when I clicked the numpad.
Private Sub nud1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nud1.ValueChanged
Dim input As String 'declaring as string
input = txtinput.Text 'input = textbox
txtright.Text = Strings.Right(input, nud1.Value) 'will input each letter from right to left according to nud value
input = txtinput.Text 'input = textbox
txtleft.Text = Strings.Left(input, nud1.Value) 'will input each letter from right to left according to nud value
If nud1.Value > Len(input) Then 'if nud1.value is greater than the string length and error box will appear
MsgBox("doesnt go that high, try agian", MsgBoxStyle.Critical, "String Handler")
End If
End Sub
Thanks,
Netnewb2002
I need some help with .NET for Visual Basic. Probably is extremely easy for you pros, but it's sure giving me a head ache.
I have a textbox, named txtinput.text and a numpad, named nud1.value.
At runtime text will be inputed into txtinput, and the numpad: Whether clicked up or down will display the left letters, center letters, and right letters, of the string.
I've have figured out how to get the left and the right side to work properly, but for the center, I have no clue.
txtleft.text 'displays the left side of the string
txtcenter.text 'displays the center of the string
txtright.text 'displays the right side of the string
This is my code for the numpad. No idea on how to get the center of the string to display correctly, any help? I deleted the mid function I tried, cause at run time it would start way out at the right end of the string, and go backwards when I clicked the numpad.
Private Sub nud1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nud1.ValueChanged
Dim input As String 'declaring as string
input = txtinput.Text 'input = textbox
txtright.Text = Strings.Right(input, nud1.Value) 'will input each letter from right to left according to nud value
input = txtinput.Text 'input = textbox
txtleft.Text = Strings.Left(input, nud1.Value) 'will input each letter from right to left according to nud value
If nud1.Value > Len(input) Then 'if nud1.value is greater than the string length and error box will appear
MsgBox("doesnt go that high, try agian", MsgBoxStyle.Critical, "String Handler")
End If
End Sub
Thanks,
Netnewb2002