Code:
REM This macro demonstrates how to handle properties, methods and events for Grid ActiveX control
REM Delays required for correct work may need to be adjusted depending on the system used
PRINT chr$(27) ; "_201;1;5;40;20;40wGRID1;MSFlexGridLib.MSFlexGrid.1" ; chr$(27);"\" ;
PRINT chr$(27);"_203wGRID1;EDITABLE;TRUE" ; chr$(27);"\" ;
PRINT chr$(27);"_203wGRID1;COLS;5" ;chr$(27);"\" ;
PRINT chr$(27);"_203wGRID1;FIXEDCOLS;1";chr$(27);"\" ;
PRINT chr$(27);"_203wGRID1;FORMATSTRING; LOGON||TOTAL ||VOLUME||DAYS||VAL";chr$(27);"\" ;
PRINT chr$(27);"_203wGRID1;REDRAW;TRUE";chr$(27);"\" ;
PRINT chr$(27);"_203wGRID1;TEXTARRAY;1;aaaa";chr$(27);"\" ;
PRINT chr$(27);"_203wGRID1;TEXTARRAY;7;bbbbb";chr$(27);"\" ;
PRINT chr$(27);"_204wGRID1;ADDITEM;CPA"+chr$(9)+"38,029.00"+chr$(9)+"45"+chr$(9)+"30"+chr$(9)+"25";chr$(27);"\" ;
DELAY 1
PRINT chr$(27);"_204wGRID1;ADDITEM;APA"+chr$(9)+"8,029.00"+chr$(9)+"5"+chr$(9)+"3"+chr$(9)+"2";chr$(27);"\" ;
REM
DIM CellText$, Event$, EventName$ AS STRING
DIM CellRow$,CellCol$ AS STRING
REM
DELAY 1
PRINT chr$(27);"_202wGRID1;TEXTARRAY;7";chr$(27);"\" ;
INPUT CellText$
PRINT CellText$
CellText$= id$(CellText$)
PRINT "Text in cell 7 is *" ;CellText$;"*"
DELAY 1
PRINT chr$(27);"_203wGRID1;TEXTARRAY;6;";CellText$;chr$(27);"\" ;
REM
PRINT chr$(27);"_203wGRID1;ENABLEEVENT;EnterCell;";chr$(27);"\" ;
PRINT chr$(27);"_15;2;16wGRID1";chr$(27);"\";
INPUT Event$
PRINT Event$
EventName$ = Field$(Event$,",",3)
PRINT EventName$
IF EventName$="EnterCell" THEN
PRINT chr$(27);"_202wGRID1;Row";chr$(27);"\" ;
INPUT CellRow$
PRINT CellRow$
PRINT chr$(27);"_202wGRID1;Col";chr$(27);"\" ;
INPUT CellCol$
PRINT CellCol$
CellRow$ = id$(CellRow$)
CellCol$ = id$(CellCol$)
PRINT chr$(27);"_202wGRID1;TEXTMATRIX;"+CellRow$+";"+CellCol$;chr$(27);"\" ;
INPUT CellText$
PRINT CellText$
ENDIF
REM
DELAY 10
PRINT chr$(27) ; "_10wGRID1" ; chr$(27) ; "\" ;