I have a strange one.
Create a new form. Then add the following function :
protected override void OnLoad ( EventArgs e )
{
if ( _goWrong )
{
this.MinimumSize = new System.Drawing.Size ( 420, 161 );
this.Font = new Font ( "Tahoma", this.Font.Size, this.Font.Style );
}
TextBox box = new TextBox ();
this.Controls.Add ( box );
}
If _goWrong is false, so we dont set the minimum size or change the font, when I open up the form the focus is on the newly created TextBox. The user can then happily type away..
If _goWrong is true, so we do set the minimum size and change the font, when the form is opened, the focus is nowhere to be seen!
What the hell is going on? Why would this have any effect on the focus? Am I missing something here?
This is in .Net 2.0.5
Thanks