Date: 02-16-2022
Return to Index
created by gbSnippets
'Some controls consist of built-in child controls:
Edit Control of ComboBox
ListBox of ComboBox
Edit Control of TreeView
Page (Dialog) of TAB
Button of Toolbar
Header of ListView
' Edit Control of ComboBox
' ListBox of ComboBox
' Edit Control of TreeView
' Page (Dialog) of TAB
' Button of Toolbar
' Header of ListView
ListView Get HeaderID hDlg, %IDC_ListView TO hListView, HeaderID
'Compilable Example: (Jose Includes)
#Compile Exe
#Option AnsiApi
#Dim All
%Unicode=1
#Include "Win32API.inc"
Global hDlg As Dword
Function PBMain() As Long
Dialog New Pixels, 0, "Test Code",300,300,500,750, %WS_OverlappedWindow To hDlg
Control Add Button, hDlg, 100,"Test for Unicode", 10,50,120,20
Control Add ComboBox, hDlg, 204, , 10,250,100,20 'Edit and ListBox child controls
Control Add ListView, hDlg, 215, "ListView", 300,250,100,40 'Header child control
Control Add Tab, hDlg, 220, "TAB", 300,500,100,20 'Dialog (Page) child controls
Control Add Toolbar, hDlg, 222, "Toolbar", 300,600,100,20 'Button child controls
Control Add Treeview, hDlg, 223, "TreeView", 300,650,100,40 'Edit control child control
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Local temp$, hEditCB, hListBoxCB, hHeaderLV, hDialogTAB, hEditTV As Long
Select Case Cb.Msg
Case %WM_Command
Select Case Cb.Ctl
Case 100
temp$ = temp$ + "Edit of ComboBox " + Str$(hEditCB) + $CrLf
temp$ = temp$ + "ListBox of ComboBox " + Str$(hListBoxCB) + $CrLf
temp$ = temp$ + "Header of ListView " + Str$(hHeaderLV) + $CrLf
temp$ = temp$ + "Dialog of TAB " + Str$(hDialogTAB) + $CrLf
temp$ = temp$ + "Edit of TreeView " + Str$(hEditTV) + $CrLf
MsgBox temp$, %MB_Ok + %MB_IconInformation, "Child Control Handles"
End Select
End Select
End Function
'gbs_01179
'Date: 04-08-2012
http://www.garybeene.com/sw/gbsnippets.htm