Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compiler PBWin 9, PBWin 10
#Compile EXE
#Dim All
%Unicode=1
#Include "Win32API.inc"
%IDC_Button = 500
%IDC_ListBox = 501
%IDC_TextBox = 502
Global hDlgA,hDlgB,hDlgC As Dword
Function PBMain() As Long
Dialog New Pixels, 0, "Test Code",300,300,200,200, %WS_OverlappedWindow To hDlgA
Control Add Button, hDlgA, %IDC_Button, "Get Selected", 10,10,75,25
Control Add TextBox, hDlgA, %IDC_TextBox, "", 10,40,150,20
Dialog Show Modal hDlgA Call DlgProc
End Function
CallBack Function DlgProc() As Long
Local temp$
Select Case Cb.Msg
Case %WM_InitDialog
DisplayDialogB
Case %WM_Command
Select Case Cb.Ctl
Case %IDC_Button
Select Case Cb.CtlMsg
Case %BN_Clicked
ListBox Get Text hDlgB, %IDC_ListBox To temp$
Control Set Text hDlgA, %IDC_TextBox, temp$
End Select
End Select
End Select
End Function
Sub DisplayDialogB()
Dialog New Pixels, hDlgA, "DialogB", 100, 100, 150,150, %WS_OverlappedWindow To hDlgB
Control Add ListBox, hDlgB, %IDC_ListBox, , 10,10,100,100
ListBox Add hDlgB, %IDC_ListBox, "one"
ListBox Add hDlgB, %IDC_ListBox, "two"
ListBox Add hDlgB, %IDC_ListBox, "three"
Dialog Show Modeless hDlgB Call DlgProcB()
End Sub
CallBack Function DlgProcB() As Long
Local temp$
Select Case Cb.Msg
Case %WM_Command
Select Case Cb.Ctl
Case %IDC_ListBox
Select Case Cb.CtlMsg
Case %LBN_DblClk
ListBox Get Text hDlgB, %IDC_ListBox To temp$
Control Set Text hDlgA, %IDC_TextBox, temp$
End Select
End Select
End Select
End Function
'gbs_00136
http://www.garybeene.com/sw/gbsnippets.htm