Date: 02-16-2022
Return to Index
created by gbSnippets
'This skeleton is used throughout the edit control snippets in this library.
'Primary Code:
'style& and text content are separately defined, then placed in the Control Add statement.
Local style&, buf$
style& = %WS_TabStop Or %WS_Border Or %ES_Left Or %ES_AutoHScroll Or %ES_MultiLine Or %ES_NoHideSel Or %ES_WantReturn
buf$ = "This is sample" + $CrLf + "text for the" + $CrLf + "edit control."
Control Add TextBox, hDlg, 200,buf$, 50,50,100,100, style&
'Compilable Example: (Jose Includes)
#Compiler PBWin 9, PBWin 10
#Compile EXE
#Dim All
%Unicode=1
#Include "Win32API.inc"
Global hDlg As DWord, hEdit As DWord
Function PBMain() As Long
Local style&, buf$
style& = %WS_TabStop Or %WS_Border Or %ES_Left Or %ES_AutoHScroll Or %ES_MultiLine Or %ES_NoHideSel Or %ES_WantReturn
buf$ = "This is sample" + $CrLf + "text for the" + $CrLf + "edit control."
Dialog New Pixels, 0, "TextBox Test",300,300,200,200, %WS_SysMenu, 0 To hDlg
Control Add Button, hDlg, 100,"Push", 50,20,100,20
Control Add TextBox, hDlg, 200,buf$, 50,50,100,100, style&
Control Handle hDlg, 200 To hEdit
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
'-----test code---------
MsgBox "No function assigned."
'-----test code---------
End If
End Function
'gbs_00122
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm