Date: 02-16-2022
Return to Index
created by gbSnippets
'Style values can be used to set the Min/Max state of a dialog.
'Primary Code:
'PowerBASIC DDT commands are available to perform the action
Dialog Show State hDlg, %SW_Minimize
Dialog Show State hDlg, %SW_Maximize
Dialog Show State hDlg, %SW_Restore
'Compilable Example: (Jose Includes)
#Compiler PBWin 9, PBWin 10
#Compile EXE
#Dim All
%Unicode=1
Global hDlg As Dword
Function PBMain() As Long
Dialog New Pixels, 0, "Min/Max Test",300,300,200,200, _
%WS_SysMenu, 0 To hDlg
Control Add Button, hDlg, 100,"Minimize", 50,50,100,20
Control Add Button, hDlg, 101,"Maximize", 50,100,100,20
Control Add Button, hDlg, 102,"Restore", 50,150,100,20
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Select Case CB.Msg
Case %WM_Command
If CB.Ctl = 100 AND CB.Ctlmsg = %BN_Clicked Then Dialog Show State hDlg, %SW_Minimize
If CB.Ctl = 101 AND CB.Ctlmsg = %BN_Clicked Then Dialog Show State hDlg, %SW_Maximize
If CB.Ctl = 102 AND CB.Ctlmsg = %BN_Clicked Then Dialog Show State hDlg, %SW_Restore
End Select
End Function
'gbs_00048
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm