set cursor focus in a textbox.text on lauch app (winform) vb.net 2008

Hi Experts,

I want to set the cursor focus in a textbox.text when I open the winform in run-time.

I've tried Textbox.focus, but this doesn't appear to work.

Cheers,
Roberto
RobertoFreemanoAsked:
Who is Participating?
 
hnasrCommented:
Try
TextBox1.Select ()
0
 
leakim971PluritechnicianCommented:
Hello RobertoFreemano,

Try : myTextbox.Focus()

Source : http://msdn.microsoft.com/en-us/library/ms743469.aspx

Regards.
0
 
RobertoFreemanoAuthor Commented:
Hi leakim971,

Sadly, this did not work :(

Cheers,
Roberto
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

 
leakim971PluritechnicianCommented:
Please post your code if possible.
0
 
RobertoFreemanoAuthor Commented:
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Me.TextBox1.Focus()

End Sub
0
 
RobertoFreemanoAuthor Commented:
I've also set the tabIndex = 0
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
TabIndex should be the way to do it...is this the "startup form" or are you opening it from another one?

Perhaps something else is interfering?  Do you have any third party controls in the application?
0
 
RobertoFreemanoAuthor Commented:
Hi Idle Mind,

This is the process:

1. Form 1 = startup
2. form 1 runs splash screen form 2 for xx seconds before returning to form 1
3. form 2 has 2 buttons. if button 1 is clicked, it hides form 1 and runs form 3
4. Form 3 opens and this is were I want the focus to appear in textbox1.text

Hope this helps
P.s. I don't think I have any 3rd Party controls in the app.

Thanks,
Roberto
0
 
RobertoFreemanoAuthor Commented:
Oops- amended

Hi Idle Mind,

This is the process:

1. Form 1 = startup
2. form 1 runs splash screen form 2 for xx seconds before returning to form 1
3. form 1 has 2 buttons. if button 1 is clicked, it hides form 1 and runs form 3
4. Form 3 opens and this is were I want the focus to appear in textbox1.text

Hope this helps
P.s. I don't think I have any 3rd Party controls in the app.

Thanks,
Roberto
0
 
RobertoFreemanoAuthor Commented:
Hi hnasr,

I tried your suggestion,  and it worked.

Many thanks,

Roberto
0
 
RobertoFreemanoAuthor Commented:
Thanks hnasr
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Can you show us the Button1 code where you open Form3 and hide Form1?
0
 
hnasrCommented:
Welcome!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.