Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compile Exe
#Dim All
#Include "Win32API.inc"
#Include "mlg.inc"
Enum Equates Singular
IDC_Grid = 500
End Enum
Global hDlg, hGrid As Dword
Function PBMain() As Long
Dialog New Pixels, 0, "MLG Example",300,300,600,350, %WS_OverlappedWindow To hDlg
CreateGrid
Dialog Show Modal hDlg Call DlgProc
End Function
Sub CreateGrid
Local temp$
temp$ = "r10" '#rows
temp$ += "/c4" '#columns
temp$ += "/j11,2,3,4" 'column titles
temp$ += "/x20,50,50,50,50" 'column widths (row, then data columns)
temp$ += "/f3" 'font 1-CourierNew 2-TimesRoman 3-Arial
temp$ += "/a2" 'row header - 1-arrows 2-suppress autonumbering
temp$ += "/s12" 'font size
temp$ += "/m1One,Two,Three" 'context menu
MLG_Init
Control Add "MyLittleGrid", hDlg, %IDC_Grid, temp$, 10,10,580,330, %MLG_STYLE
Control Handle hDlg, %IDC_Grid To hGrid
End Sub
CallBack Function DlgProc() As Long
Local w,h As Long
Select Case Cb.Msg
Case %WM_Paint
Control ReDraw hDlg, %IDC_Grid
Case %WM_Size
Dialog Get Client hDlg To w,h
Control Set Size hDlg, %IDC_Grid, w-20, h-20
End Select
End Function
http://www.garybeene.com/sw/gbsnippets.htm