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
IDC_Button
End Enum
Global hDlg, hGrid As Dword
Global D() As String
Function PBMain() As Long
Local P, Rows, Cols As Long
Dialog Default Font "Tahoma", 10,0
Dialog New Pixels, 0, "MLG Example",300,300,600,350, %WS_OverlappedWindow To hDlg
Control Add Button, hDlg, %IDC_Button, "Show (1,1)", 20,320,75,20
MLG_Init
Control Add "MyLittleGrid", hDlg, %IDC_Grid, "r10/c4", 10,10,580,300, %MLG_STYLE
Control Handle hDlg, %IDC_Grid To hGrid
Rows = 10 : Cols = 4
P = SendMessage(hGrid, %MLG_GetArrayPTR, VarPtr(Rows), VarPtr(Cols))
ReDim D(Rows,Cols) At P
D(1,1) = "Start"
D(5,1) = "Start"
D(0,1) = "01"
D(1,0) = "10"
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Local w,h As Long
Select Case Cb.Msg
Case %WM_Command
Select Case Cb.Ctl
Case %IDC_Button
? D(1,1)
End Select
Case %WM_Paint
Control ReDraw hDlg, %IDC_Grid
End Select
End Function
http://www.garybeene.com/sw/gbsnippets.htm