setting focus to a control

  • Thread starter Thread starter Dave Cullen
  • Start date Start date
D

Dave Cullen

I have an application that puts a combo box on a tab control form at run
time. The cobo box should have focus when the form appears (cursor in
the box). I can't find any SetFocus methods or properties for the form
to allow me to do that.

What I have are these assignments in an InitializeComponents() method:

this.cboFindSpec.DropDownStyle =
System.Windows.Forms.ComboBoxStyle.Simple;
this.cboFindSpec.Location = new System.Drawing.Point(144, 64);
this.cboFindSpec.Name = "cboFindSpec";
this.cboFindSpec.Size = new System.Drawing.Size(176, 232);
this.cboFindSpec.TabIndex = 5;

.... and a form load procedure that calls it. Where and how would one
normally set focus to a specific control?

Thanks.
 
Back
Top