Toon posts:

[Delphi/C++] Selecteer Child Windows met Tab-toets

Pagina: 1
Acties:

Verwijderd

Topicstarter
Ik ben bezig met een proggie te schrijven met Win32 API functies. Nu heb ik een window gemaakt met een tab-control en een drietal buttons.
Ik heb geprobeerd om het window zo te maken dat je kunt navigeren door de child-controls (tab-control en 3 buttons...) d.m.v. de Tab-toets. Maar het lukt maar nie... :?

Kan iemand mij misschien zeggen wat ik fout doe, of wat ik eigenlijk moet doen ???

Ik heb hiervoor de volgende code gebruikt:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
var HTabControl: THandle;
    HButton1: THandle;
    HButton1: THandle;
    HButton1: THandle;

procedure WinOnCreate;
begin
 Hwnd := CreateWindowEx (WS_EX_CONTROLPARENT or WS_EX_TOOLWINDOW, 'WinClass', 'Win', 
WS_SYSMENU or WS_BORDER, 10, 10, 475, 400, 0, 0, hInstance, nil);

HTabControl := CreateWindowEx (0, WC_TABCONTROL, 'TabControl', WS_CHILD or WS_CLIPSIBLINGS or 
WS_TABSTOP or WS_VISIBLE, 10, 10, 430, 320, Hwnd, 0, hInstance, nil);

HButton1 := CreateWindow('BUTTON', 'OK', BS_DEFPUSHBUTTON or WS_CHILD or WS_TABSTOP or WS_VISIBLE, 
350, 340, 75, 25, Hwnd, 0, hInstance, nil);

HButton2 := CreateWindow('BUTTON', 'Cancel', BS_PUSHBUTTON or WS_CHILD or WS_TABSTOP or WS_VISIBLE, 
260, 340, 75, 25, Hwnd, 0, hInstance, nil);

HButton3 := CreateWindow('BUTTON', 'Apply', BS_PUSHBUTTON or WS_CHILD or WS_TABSTOP or WS_VISIBLE, 
170, 340, 75, 25, Hwnd, 0, hInstance, nil);

end;