Keep focus on one text box
hi there
Im looking to keep focus in my first text box even after i have selected on different options.
basically i have 10 command buttons giving different info into the txtNamebox.Text
VB Code:
Private Sub cmdIcon_click(Index As Integer)
Select Case Index
Case 0
txtNamebox.Text = txtNamebox.Text + Format$("1")
Case 1
txtNamebox.Text = txtNamebox.Text + Format$("2")
But after selecting one of them command buttons , i have to manually select the first text box again to type into.
.Please help/
I have the first text box as tab index 0 and the rest disabled but that doesnt work
Re: Keep focus on one text box
VB Code:
Private Sub cmdIcon_click(Index As Integer)
Select Case Index
Case 0
txtNamebox.Text = txtNamebox.Text + Format$("1")
Case 1
txtNamebox.Text = txtNamebox.Text + Format$("2")
End Select
txtNamebox.SetFocus
End Sub
Re: Keep focus on one text box
ahaha setFocus man you rock thanks
Re: Keep focus on one text box
that worked great how ever i need it to goto the end of the text box no matter what data is in there.
thanks
Re: Keep focus on one text box
VB Code:
Private Sub Text1_GotFocus()
Text1.SelStart = Len(Text1)
End Sub
Re: Keep focus on one text box
sorry maybe im not explaining this right,
After i select a command button i want i too automatically go back to Textbox 1 > and setfocus to the end of the Textbox1
Re: Keep focus on one text box
ahh yer i see what i needed to do now .
thanks alot
Re: Keep focus on one text box
VB Code:
Private Sub Command1_Click()
Text1.SelStart = Len(Text1.Text)
Text1.SetFocus
End Sub