Date: 02-16-2022
Return to Index
created by gbSnippets
'BEYOND THE SWITCHES - STYLES and DATA SETTINGS
'formatting can be done at entire grid level
'formatting can be done at the row/column level - but normally at COLUMN basis
'formatting is NOT done at a cell level
%SetGridExStyle GRIDINIT structure - special fonts and BG colors
%SetRowFormat ROWCOLDATA structure -
%SetColFormat ROWCOLDATA structure - data type in cell
'NAVIGATION
ENTER - move down
Shift+Enter - move up
TAB - move right
Shift+TAB - move left
'SELECTION
%MLG_SetSelected - select cell and move to visual veiw
%MLG_SetTopRow - scroll a row to top of grid
%MLG_SetLeftCol - scroll a row to left side of grid
'GET CELL(S)
s = MLG_Get(hGrid, row,col,sheet) 'get one cell - sheet optional
SendMessage hGrid, %MLG_GetCell, MakLng(row,col), VarPTR(s) 'get one cell
Dim s(3 to 7, 1 to 10) as String
MLG_GetEx hGrid, s() gets cells 'get block of cells
'SET CELL(S)
MLG_Put hGrid, row, col VarPTR(s), refresh, sheet 'set one cell - sheet optional
SendMessage hGrid, %MLG_SetCell, MakLng(row,col), VarPtr(s)
MLG_PutEX hGrid, s(), refresh, sheet 'set block of cells - sheet optional
'GET/SET CELLS WITH ABSOLUTE ARRAY
Dim a as Long
a = SendMessage(hGrid, %MLG_GetArrayPTR, VarPtr(Rows), VarPtr(Cols)
Dim GridData(Rows,Cols) as String At a
a(3,5) = "hello"
http://www.garybeene.com/sw/gbsnippets.htm