Author Topic: SOLVED: Set Focus to Control  (Read 3226 times)

outsider

  • Community Member
  • Posts: 64
  • Hero Points: 1
SOLVED: Set Focus to Control
« on: July 01, 2011, 05:14:56 PM »
Hi guys,

Does anybody know how to do this?

I can't see how from the documentation.

Specifically, I want to set the focus to a text box control when I load my form (and select the default text inside it).

Thanks

SOLUTION:

The example in the documentation is incorrect. You need to add a line containing _set_focus().

Code: [Select]
#include 'slick.sh'
defeventtab form1;
form1.on_load()
{
    // Change the focus to the text2 control
    p_window_id=_control text2;
    // ADD THE FOLLOWING LINE
    _set_focus()
}

« Last Edit: July 01, 2011, 05:40:39 PM by outsider »