Quote:
Originally Posted by pitaridis
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.
|
That is not correct. Select with no parameters is inherited from the control class and simply sets focus to the control. It's functionally equivalent to setting the ActiveControl property. Select with two Integer parameters is for selecting text within the control and it will NOT affect focus at all.
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.