![]() |
Click here to advertise with us
|
|
|||||||
| VB.NET General Discussion VB.NET general discussion area |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
hi all
i have 4 forms i have made a password form(form4) wich i started when form 1 loads Code:
If My.Settings.Userpassenable = Enabled Then
Form4.ShowDialog()
End If
maskedtextbox1.focse() but the combo box on form 1 keep taking focus i found that out by setting Form4.ShowDialog() to Form4.Show() on form 1 any ideas ? thank you |
|
|||
|
My friend in order to set the focus to a control you have to make it like this:
Code:
Me.ActiveControl = maskedtextbox1
__________________
If you can help someone, just do it. Do not try to prove that you are more cleaver than other people. Excuse me for my English but I am from Greece and my English is not perfect. |
|
|||
|
The select method is for selecting the contents of the control. Of course the select method will activate the control but this is not the right way to activate it.
__________________
If you can help someone, just do it. Do not try to prove that you are more cleaver than other people. Excuse me for my English but I am from Greece and my English is not perfect. |
|
|||
|
thank you both very much
i went with "Me.ActiveControl = maskedtextbox1" but "maskedtextbox1.select" will be a good thing to remember thank you both again |
|
||||
|
Quote:
MaskedTextBox.Select Method (System.Windows.Forms) As for the original question, there's probably no need to explicitly set focus to any particular control. When a form is displayed for the first time it will focus the first control in the tab order. If you want your MaskedTextBox to initially have focus then you should simply make it first in the tab order. This may not be possible in a complex layout but for simple forms it's the best way to go.
__________________
![]() 2007, 2008, 2009, 2010 Why is my data not saved to my database? | Communicating between multiple forms MSDN: Data Walkthroughs | "How Do I?" Videos My Blog: Custom Events | Dynamic GDI+ Drawing |
|
|||
|
The tab order is an other good idea that you suggested. Anyway, I think that we helped didgydont to solve his problem.
Have a nice day both of you.
__________________
If you can help someone, just do it. Do not try to prove that you are more cleaver than other people. Excuse me for my English but I am from Greece and my English is not perfect. |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|