Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compiler PBWin 9, PBWin 10
#Compile EXE
#Debug Error On
#Debug Display On
#Dim All
%Unicode=1
#Include "Win32API.inc"
Global hDlg,hFont As Dword
Function PBMain() As Long
Dialog New Pixels, 0, "Test Code",300,300,200,200, %WS_OverlappedWindow To hDlg
Control Add Button, hDlg, 100,"Set Font to 0", 10,10,80,20
Control Add Button, hDlg, 110,"End Font", 100,10,60,20
Control Add Graphic, hDlg, 200, "", 10,40,100,100
Graphic Attach hDlg, 200
Font New "Arial",12,1 To hFont
Graphic Set Font hFont
Graphic Print "Dog"
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
If Cb.Msg = %WM_Command And Cb.Ctl = 100 And Cb.CtlMsg = %BN_Clicked Then
Graphic Clear
Graphic Set Font 0
End If
If Cb.Msg = %WM_Command And Cb.Ctl = 110 And Cb.CtlMsg = %BN_Clicked Then
Font End hFont
End If
End Function
'gbs_00855
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm