Antonio,
Is there a method to set focus to dialog control ? In window this command work as expected:
- Code: Select all Expand view RUN
Activate Window oWnd On Init oCtl : SetFocus ()
In dialog focus is set to first control with WS_TABSTOP message. Command:
- Code: Select all Expand view RUN
Activate Dialog oDlg On Init oCtl : SetFocus ()
don't move focus to oCtl control.
Thanks for help
Pawel
Working sample:
- Code: Select all Expand view RUN
// prg file
#Include 'FwCe.Ch'
Function Test ()
Local oDlg := Nil
Local oGet := Nil
Local cGet := ''
Local nGet := 999999.99
Define Dialog oDlg Resource 'NALKPKW'
ReDefine Get cGet Id 1015 Of oDlg MultiLine
ReDefine Get oGet Var nGet Id 1018 Of oDlg Picture '999,999.99'
Activate Dialog oDlg On Init (DlgFullScr (oDlg : hWnd), oGet : SetFocus ())
Return .T.
#pragma BEGINDUMP
#include <hbapi.h>
#include <windows.h>
#include <aygshell.h>
HB_FUNC (DLGFULLSCR)
{
SHINITDLGINFO shidi;
HWND hDlg = (HWND) hb_parnl (1);
shidi.dwMask = SHIDIM_FLAGS;
shidi.hDlg = hDlg;
shidi.dwFlags = SHIDIF_EMPTYMENU|SHIDIF_SIZEDLGFULLSCREEN;
SHInitDialog (&shidi);
}
#pragma ENDDUMP
// rc file
#include <windows.h>
#include <commctrl.h>
LANGUAGE LANG_POLISH,SUBLANG_DEFAULT
NALKPKW DIALOG DISCARDABLE 0, 0, 136, 154
STYLE WS_POPUP|DS_MODALFRAME|WS_CAPTION|WS_VISIBLE
CAPTION "KP/KW"
FONT 10, "System"
BEGIN
CONTROL "Numer:", 1001, "Static", SS_RIGHT|WS_GROUP, 0, 2, 26, 11
CONTROL "Data:", 1002, "Static", SS_RIGHT|WS_GROUP, 0, 14, 26, 11
CONTROL "Klient:", 1003, "Static", SS_RIGHT|WS_GROUP, 0, 26, 26, 11
CONTROL "Tytul:", 1004, "Static", SS_RIGHT|WS_GROUP, 0, 48, 26, 11
CONTROL "Wart/Z:", 1005, "Static", SS_RIGHT|WS_GROUP, 0, 80, 26, 11
CONTROL "Kwota:", 1006, "Static", SS_RIGHT|WS_GROUP, 0, 92, 26, 11
CONTROL "Nr wew:", 1007, "Static", SS_RIGHT|WS_GROUP, 68, 92, 30, 11
CONTROL "Ulica:", 1008, "Static", SS_RIGHT|WS_GROUP, 0, 104, 26, 11
CONTROL "Pna:", 1009, "Static", SS_RIGHT|WS_GROUP, 0, 116, 26, 11
CONTROL "Miasto:", 1010, "Static", SS_RIGHT|WS_GROUP, 0, 128, 26, 11
CONTROL "", 1011, "Edit", ES_AUTOHSCROLL|ES_UPPERCASE|ES_READONLY|WS_BORDER, 26, 2, 42, 11
CONTROL "", 1012, "Edit", ES_AUTOHSCROLL|ES_READONLY|WS_BORDER, 26, 14, 42, 11
CONTROL "", 1013, "Edit", ES_AUTOHSCROLL|ES_READONLY|WS_BORDER, 70, 14, 42, 11
CONTROL "", 1014, "Edit", ES_MULTILINE|ES_AUTOVSCROLL|ES_UPPERCASE|ES_READONLY|WS_VSCROLL|WS_BORDER, 26, 26, 108, 21
CONTROL "", 1015, "Edit", ES_MULTILINE|ES_AUTOVSCROLL|ES_UPPERCASE|WS_VSCROLL|WS_BORDER|WS_TABSTOP, 26, 48, 108, 31
CONTROL "", 1016, "Edit", ES_RIGHT|ES_NUMBER|ES_AUTOHSCROLL|ES_READONLY|WS_BORDER, 26, 80, 42, 11
CONTROL "", 1017, "Edit", ES_RIGHT|ES_NUMBER|ES_AUTOHSCROLL|ES_READONLY|WS_BORDER, 70, 80, 42, 11
CONTROL "", 1018, "Edit", ES_RIGHT|ES_NUMBER|ES_AUTOHSCROLL|WS_BORDER|WS_TABSTOP, 26, 92, 42, 11
CONTROL "", 1019, "Edit", ES_RIGHT|ES_NUMBER|ES_AUTOHSCROLL|WS_BORDER|WS_TABSTOP, 98, 92, 36, 11
CONTROL "", 1020, "Edit", ES_AUTOHSCROLL|ES_UPPERCASE|ES_READONLY|WS_BORDER, 26, 104, 108, 11
CONTROL "", 1021, "Edit", ES_AUTOHSCROLL|ES_UPPERCASE|ES_READONLY|WS_BORDER, 26, 116, 32, 11
CONTROL "", 1022, "Edit", ES_AUTOHSCROLL|ES_UPPERCASE|ES_READONLY|WS_BORDER, 26, 128, 108, 11
CONTROL "Zapisz", 1023, "Button", WS_TABSTOP, 64, 140, 34, 11
CONTROL "Anuluj", 1024, "Button", WS_TABSTOP, 100, 140, 34, 11
END