Date: 02-16-2022
Return to Index
created by gbSnippets
'An online TAB control tutorial may be found at:
'http://www.garybeene.com/power/pb-tutor-controls.htm
'Primary Code:
'Syntax: Control Add Tab, hDlg, id&, txt$, x, y, xx, yy [, [style&] [, [exstyle&]]] [[,] Call CallBack]
Control Add Tab, hDlg, 500, "", 20,20,100,150
'Compilable Example: (Jose Includes)
'The following compilable code demonstrates a dialog with a TAB control
'which contains label and textbox controls.
'The Dialog CallBack response to changing the TAB panels is demonstrated.
'Controls can also have a Callback function of their own.
#Compiler PBWin 9, PBWin 10
#Compile EXE
#Dim All
%Unicode=1
Global hDlg As Dword
Function PBMain() As Long
Dim hPage1 As Long, hPage2 As Long
Dialog New Pixels, 0, "TAB Test",300,300,200,200, %WS_SysMenu, 0 To hDlg
Control Add Tab, hDlg, 500, "", 20,20,100,150
Tab Insert Page hDlg, 500, 1,0,"Page1" To hPage1
Control Add Label, hPage1, 600, "Label1", 20,20,60,20
Control Add Label, hPage1, 601, "Label2", 20,50,60,20
Control Add Label, hPage1, 602, "Label3", 20,80,60,20
Tab Insert Page hDlg, 500, 2,0,"Page2" To hPage2
Control Add TextBox, hPage2, 603, "Text1", 20,20,60,20
Control Add TextBox, hPage2, 604, "Text2", 20,50,60,20
Control Add TextBox, hPage2, 605, "Text3", 20,80,60,20
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
If CB.Nmcode = %TCN_SelChange Then
MsgBox "click"
End If
End Function
'gbs_00102
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm