I wrote this a while back when I first looked at controls.
[code=thinbasic]
USES "UI"
Dim hDlg As DWORD
Dim Msg, wparam,lparam As DWORD
%width = 500
%height = 350
dim txt1(5) as string
dim txt2(5) AS STRING
DIM txt3(5) AS STRING
DIM txt4(5) AS STRING
dim mynumber as double
%width = 500
%height = 350
DIALOG New 0, "ThinBasic",-1,-1, %width, %height, _
%WS_POPUP Or _
%WS_VISIBLE Or _
%WS_CLIPCHILDREN Or _
%WS_CAPTION Or _
%WS_SYSMENU Or _
%WS_MINIMIZEBOX, _
0 To hDlg
txt1(1) = "1"
txt1(2) = "2"
txt1(3) = "3"
txt1(4) = "4"
txt1(5) = "5"
txt2(1) = "A"
txt2(2) = "B"
txt2(3) = "C"
txt2(4) = "D"
txt2(5) = "E"
CONTROL ADD BUTTON, hDlg, 1001, "1", 50,125,60, 15
CONTROL ADD BUTTON, hDlg, 1002, "2", 150,125,60, 15
CONTROL ADD BUTTON, hDlg, 1003, "3", 250,125,60, 15
CONTROL ADD BUTTON, hDlg, 1004, "4", 350,125,60, 15
CONTROL ADD Checkbox, hDlg, 2001, "1", 50,200,30, 15
CONTROL ADD Checkbox, hDlg, 2002, "2", 150,200,60, 15
CONTROL ADD Checkbox, hDlg, 2003, "3", 250,200,60, 15
CONTROL ADD Checkbox, hDlg, 2004, "4", 350,200,60, 15
CONTROL ADD OPTION, hDlg, 3001, "1", 50,275,30, 30
CONTROL ADD OPTION, hDlg, 3002, "2", 150,275,30, 30
CONTROL ADD OPTION, hDlg, 3003, "3", 250,275,30, 30
CONTROL ADD OPTION, hDlg, 3004, "4", 350,275,30, 30
CONTROL ADD COMBOBOX, hDlg, 4002, TXT1(), 50,250,30, 30
CONTROL ADD COMBOBOX, hDlg, 4002, TXT2(), 150,250,30, 30
CONTROL DISABLE hDlg, 1002
CONTROL DISABLE hDlg, 1003
CONTROL DISABLE hDlg, 1004
CONTROL DISABLE hDlg, 2002
CONTROL DISABLE hDlg, 2003
CONTROL DISABLE hDlg, 2004
CONTROL DISABLE hDlg, 3002
CONTROL DISABLE hDlg, 3003
CONTROL DISABLE hDlg, 3004
DIALOG SHOW MODELESS hDlg
txt1(1) = "hhh"
While ISWINDOW(hDlg)
Msg = GETMESSAGE(hDlg, wParam, lParam)
Select Case Msg
Case %WM_Command
If wParam = 1001 Then CONTROL ENABLE hDlg, 1002
If wParam = 1002 Then CONTROL ENABLE hDlg, 1003
If wParam = 1003 Then CONTROL ENABLE hDlg, 1004
If wParam = 1004 Then EXiT WHILE
If wParam = 2001 Then CONTROL ENABLE hDlg, 2002
If wParam = 2002 Then CONTROL ENABLE hDlg, 2003
If wParam = 2003 Then CONTROL ENABLE hDlg, 2004
If wParam = 2004 Then EXiT WHILE
If wParam = 3001 Then CONTROL ENABLE hDlg, 3002
If wParam = 3002 Then CONTROL ENABLE hDlg, 3003
If wParam = 3003 Then CONTROL ENABLE hDlg, 3004
If wParam = 3004 Then EXiT WHILE
Case %WM_SYSCOMMAND
If wParam = %SC_Close Then Exit While
End Select
Wend
DIALOG End hDlg
DIALOG SHOW MODELESS hDlg
STOP
[/code]
Bookmarks