setCtlFocus

Syntax

int setCtlFocus(int n)

Arguments

n
The number of the user control that will receive focus

Return

Returns false if the control number is out of range, a preview control or not in use. Returns NULL if the parameter is otherwise invalid. Otherwise, returns a handle to the user control.

Description

Sets the keyboard focus to the specified user control.

Example

%fml
ctl[0]: STANDARD(MOUSEOVER), Text="Zero", Val=0
ctl[1]: STANDARD(MOUSEOVER), Text="One", Val=75
ctl[2]: STANDARD(MOUSEOVER), Text="Two", Val=150
ctl[3]: STANDARD(MOUSEOVER), Text="Three", Val=225

OnCtl(n): {

  // When the mouse is moved over
  // one of the slider controls
  // it will light up with focus.

  if (e == FME_MOUSEOVER) {
    setCtlFocus(n);
  }
  return true;
}