Control question

  • Thread starter Thread starter web1110
  • Start date Start date
W

web1110

Hi y'all,

When I make a control visible that has several subordinate controls in it,
how can I direct the focuss to the first subcontrol.

Thanx,
Bill
 
web1110 said:
When I make a control visible that has several subordinate controls in it,
how can I direct the focuss to the first subcontrol.

Locate the first subcontrol on your containingControl,

Control subcontrol = containingControl.Controls[ 0];

Next, provided subcontrol is Visible and Enabled (it returns
true when you check subcontrol.CanFocus) you call its
Focus( ) method,

bool gotFocus = subcontrol.Focus( );


Derek Harmon
 
Thanx, that worked fine.

One more follow up. How did I identify the subcontrol that currently has
the focus?

Thanx again,
Bill
 
Back
Top