Archive: Setting focus on cotrols


Setting focus on cotrols
How to set focus on text edit control? I understand that I can obtain a handle for a control, but there's no function like SetFocus(handle)?

It is useful for setting cursor on text edit with incorrect user input.

Thanks.


http://forums.winamp.com/showthread....59#post1444459


Thanks alot!


Originally posted by deguix
http://forums.winamp.com/showthread....59#post1444459
This seems to be working with Modern UI (since I'm using MUI_INSTALLOPTIONS_DISPLAY. Maybe there're some another ways to specify an initial control?

You mean, another way to specify the initial control for focus? The first field specifies the first control to have focus. If the control can't have focus (like labels) then the next control will have it.


Originally posted by deguix
You mean, another way to specify the initial control for focus? The first field specifies the first control to have focus. If the control can't have focus (like labels) then the next control will have it.
Sorry, I've missed 'not' word: I cannot make this way work. If I write something like

...
Call SetFocus
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioMyDlg.ini"

the focus is on the first focusable element, not on specified for SetFocus.

You have to load the ini file first using !insertmacro MUI_INSTALLOPTIONS_INITDIALOG and then use !insertmacro MUI_INSTALLOPTIONS_SHOW to show it.


Thanks! It works now.