Date: 02-16-2022
Return to Index
created by gbSnippets
'Primary Code:
'Credit: Paul Squires http://www.powerbasic.com/support/pbforums/showthread.php?t=40096&highlight=%25EM_Setmargins
'Compilable Example: (Jose Includes)
#Compiler PBWin 9, PBWin 10
#Compile EXE
#Dim All
%Unicode=1
#Include "Win32API.inc"
Global hDlg As DWord
Function PBMain() As Long
Local style&, buf$
style& = %WS_Child Or %WS_Visible Or %ES_MultiLine Or %ES_WantReturn Or %WS_TabStop Or %WS_Border
buf$ = "This is sample text for the edit control."
Dialog New Pixels, 0, "Test Code",300,300,200,200, %WS_OverlappedWindow To hDlg
Control Add Button, hDlg, 100,"Push", 50,10,100,20
Control Add TextBox, hDlg, 200, buf$, 50,35, 100,100, Style&
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
Control Send hDlg, 200, %EM_SetMargins, %EC_LeftMargin Or %EC_RightMargin, Mak(Long, 20,20)
End If
End Function
'gbs_00505
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm