Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: Free MstGrid ActiveX Dialog grid control
User Notes:
It seems like a decent grid but limited in usefulness. It appears that loading an XML file is the only way to load data except perhaps filling it cell by cell. The help file seems a bit out of date as there are methods listed in the Type Viewer that are not listed in the documentation. Example, if one only reads the documentation there is no way to address a specific cell in regards to reading or writing.
What is there seems nicely done...this of course being said with only a limited amount of review.
MSTGRIDTEST.XML
<MstGrid><Document><GUID>71C6C7B9-D42D-4079-B146-949BDFB332E5</GUID><Modified>2009-09-19 21:31:33</Modified><Version>1.0</Version></Document><Grid><Font Name="Tahoma" Size="9.75" Bold="True"></Font><RowCount>19</RowCount><ColCount>5</ColCount><BackColor>#80FF</BackColor><BackColorSel>#FFFFFF</BackColorSel><GridColor>#0</GridColor><DateFormat>flexMDY</DateFormat><ThemeStyle>flexTS3D</ThemeStyle><Window TopRow="1" LeftCol="1"></Window><ActiveCell Row="6" Col="1"></ActiveCell></Grid><PageSetup><Orientation>flexPaperPortrait</Orientation><PaperSize>9</PaperSize><LeftHeaderFont Name="MS Sans Serif" Size="8.25"></LeftHeaderFont><CenterHeaderFont Name="MS Sans Serif" Size="8.25"></CenterHeaderFont><RightHeaderFont Name="MS Sans Serif" Size="8.25"></RightHeaderFont><LeftFooterFont Name="MS Sans Serif" Size="8.25"></LeftFooterFont><CenterFooterFont Name="MS Sans Serif" Size="8.25"></CenterFooterFont><RightFooterFont Name="MS Sans Serif" Size="8.25"></RightFooterFont></PageSetup><Formats TTL="12" DEF="0"><Format ID="0"><Alignment>flexAlignLeftCenter</Alignment><PictureAlignment>flexPicAlignLeftCenter</PictureAlignment><BackColor>#80FF</BackColor><ForeColor>#0</ForeColor><FontName>Tahoma</FontName><FontSize>9.75</FontSize><FontBold>TRUE</FontBold><FontItalic>FALSE</FontItalic><FontUnderline>FALSE</FontUnderline><FontStrikethrough>FALSE</FontStrikethrough><EditMask>flexAny</EditMask><FormatString></FormatString><DecimalLength>0</DecimalLength><MaxLength>0</MaxLength><WrapText>FALSE</WrapText><Locked>FALSE</Locked><RefCount>96</RefCount></Format><Format ID="1"><Alignment>flexAlignLeftCenter</Alignment><PictureAlignment>flexPicAlignLeftCenter</PictureAlignment><BackColor>#80FF</BackColor><ForeColor>#0</ForeColor><FontName>Tahoma</FontName><FontSize>9.75</FontSize><FontBold>TRUE</FontBold><FontItalic>FALSE</FontItalic><FontUnderline>FALSE</FontUnderline><FontStrikethrough>FALSE</FontStrikethrough><EditMask>flexAny</EditMask><FormatString></FormatString><DecimalLength>0</DecimalLength><MaxLength>0</MaxLength><WrapText>FALSE</WrapText><Locked>FALSE</Locked><RefCount>1</RefCount></Format><Format ID="2"><Alignment>flexAlignLeftCenter</Alignment><PictureAlignment>flexPicAlignLeftCenter</PictureAlignment><BackColor>#80FF</BackColor><ForeColor>#0</ForeColor><FontName>Tahoma</FontName><FontSize>9.75</FontSize><FontBold>TRUE</FontBold><FontItalic>FALSE</FontItalic><FontUnderline>FALSE</FontUnderline><FontStrikethrough>FALSE</FontStrikethrough><EditMask>flexAny</EditMask><FormatString></FormatString><DecimalLength>0</DecimalLength><MaxLength>0</MaxLength><WrapText>FALSE</WrapText><Locked>FALSE</Locked><RefCount>1</RefCount></Format><Format ID="3"><Alignment>flexAlignLeftCenter</Alignment><PictureAlignment>flexPicAlignLeftCenter</PictureAlignment><BackColor>#80FF</BackColor><ForeColor>#0</ForeColor><FontName>Tahoma</FontName><FontSize>9.75</FontSize><FontBold>TRUE</FontBold><FontItalic>FALSE</FontItalic><FontUnderline>FALSE</FontUnderline><FontStrikethrough>FALSE</FontStrikethrough><EditMask>flexAny</EditMask><FormatString></FormatString><DecimalLength>0</DecimalLength><MaxLength>0</MaxLength><WrapText>FALSE</WrapText><Locked>FALSE</Locked><RefCount>1</RefCount></Format><Format ID="4"><Alignment>flexAlignLeftCenter</Alignment><PictureAlignment>flexPicAlignLeftCenter</PictureAlignment><BackColor>#80FF</BackColor><ForeColor>#0</ForeColor><FontName>Tahoma</FontName><FontSize>9.75</FontSize><FontBold>TRUE</FontBold><FontItalic>FALSE</FontItalic><FontUnderline>FALSE</FontUnderline><FontStrikethrough>FALSE</FontStrikethrough><EditMask>flexAny</EditMask><FormatString></FormatString><DecimalLength>0</DecimalLength><MaxLength>0</MaxLength><WrapText>FALSE</WrapText><Locked>FALSE</Locked><RefCount>1</RefCount></Format><Format ID="5"><Alignment>flexAlignLeftCenter</Alignment><PictureAlignment>flexPicAlignLeftCenter</PictureAlignment><BackColor>#80FF</BackColor><ForeColor>#0</ForeColor><FontName>Tahoma</FontName><FontSize>9.75</FontSize><FontBold>TRUE</FontBold><FontItalic>FALSE</FontItalic><FontUnderline>FALSE</FontUnderline><FontStrikethrough>FALSE</FontStrikethrough><EditMask>flexAny</EditMask><FormatString></FormatString><DecimalLength>0</DecimalLength><MaxLength>0</MaxLength><WrapText>FALSE</WrapText><Locked>FALSE</Locked><RefCount>1</RefCount></Format><Format ID="6"><Alignment>flexAlignLeftCenter</Alignment><PictureAlignment>flexPicAlignLeftCenter</PictureAlignment><BackColor>#80FF</BackColor><ForeColor>#0</ForeColor><FontName>Tahoma</FontName><FontSize>10</FontSize><FontBold>TRUE</FontBold><FontItalic>FALSE</FontItalic><FontUnderline>FALSE</FontUnderline><FontStrikethrough>FALSE</FontStrikethrough><EditMask>flexAny</EditMask><FormatString></FormatString><DecimalLength>0</DecimalLength><MaxLength>0</MaxLength><WrapText>FALSE</WrapText><Locked>FALSE</Locked><RefCount>1</RefCount></Format><Format ID="7"><Alignment>flexAlignLeftCenter</Alignment><PictureAlignment>flexPicAlignLeftCenter</PictureAlignment><BackColor>#80FF</BackColor><ForeColor>#0</ForeColor><FontName>Tahoma</FontName><FontSize>9.75</FontSize><FontBold>TRUE</FontBold><FontItalic>FALSE</FontItalic><FontUnderline>FALSE</FontUnderline><FontStrikethrough>FALSE</FontStrikethrough><EditMask>flexAny</EditMask><FormatString></FormatString><DecimalLength>0</DecimalLength><MaxLength>0</MaxLength><WrapText>FALSE</WrapText><Locked>FALSE</Locked><RefCount>1</RefCount></Format><Format ID="8"><Alignment>flexAlignLeftCenter</Alignment><PictureAlignment>flexPicAlignLeftCenter</PictureAlignment><BackColor>#80FF</BackColor><ForeColor>#0</ForeColor><FontName>Tahoma</FontName><FontSize>9.75</FontSize><FontBold>TRUE</FontBold><FontItalic>FALSE</FontItalic><FontUnderline>FALSE</FontUnderline><FontStrikethrough>FALSE</FontStrikethrough><EditMask>flexAny</EditMask><FormatString></FormatString><DecimalLength>0</DecimalLength><MaxLength>0</MaxLength><WrapText>FALSE</WrapText><Locked>FALSE</Locked><RefCount>1</RefCount></Format><Format ID="10"><Alignment>flexAlignLeftCenter</Alignment><PictureAlignment>flexPicAlignLeftCenter</PictureAlignment><BackColor>#80FF</BackColor><ForeColor>#0</ForeColor><FontName>Tahoma</FontName><FontSize>9.75</FontSize><FontBold>TRUE</FontBold><FontItalic>FALSE</FontItalic><FontUnderline>FALSE</FontUnderline><FontStrikethrough>FALSE</FontStrikethrough><EditMask>flexAny</EditMask><FormatString></FormatString><DecimalLength>0</DecimalLength><MaxLength>0</MaxLength><WrapText>FALSE</WrapText><Locked>FALSE</Locked><RefCount>1</RefCount></Format><Format ID="11"><Alignment>flexAlignLeftCenter</Alignment><PictureAlignment>flexPicAlignLeftCenter</PictureAlignment><BackColor>#80FF</BackColor><ForeColor>#0</ForeColor><FontName>Tahoma</FontName><FontSize>9.75</FontSize><FontBold>TRUE</FontBold><FontItalic>FALSE</FontItalic><FontUnderline>FALSE</FontUnderline><FontStrikethrough>FALSE</FontStrikethrough><EditMask>flexAny</EditMask><FormatString></FormatString><DecimalLength>0</DecimalLength><MaxLength>0</MaxLength><WrapText>FALSE</WrapText><Locked>FALSE</Locked><RefCount>1</RefCount></Format></Formats><MergeCells TTL="10"><MergeCell ID="0" Row1="2" Col1="1" Row2="2" Col2="1"></MergeCell><MergeCell ID="1" Row1="3" Col1="1" Row2="3" Col2="1"></MergeCell><MergeCell ID="5" Row1="2" Col1="2" Row2="2" Col2="2"></MergeCell><MergeCell ID="6" Row1="3" Col1="2" Row2="3" Col2="2"></MergeCell><MergeCell ID="8" Row1="2" Col1="3" Row2="2" Col2="3"></MergeCell><MergeCell ID="9" Row1="3" Col1="3" Row2="3" Col2="3"></MergeCell></MergeCells><Cells><Cell Row="1" Col="1" Format="1">test</Cell><Cell Row="1" Col="2">of</Cell><Cell Row="1" Col="3">MSTGrid</Cell><Cell Row="2" Col="1" Format="2">test</Cell><Cell Row="2" Col="2" Format="7">of</Cell><Cell Row="2" Col="3" Format="10">MSTGrid</Cell><Cell Row="3" Col="1" Format="3">test</Cell><Cell Row="3" Col="2" Format="8">of</Cell><Cell Row="3" Col="3" Format="11">MSTGrid</Cell><Cell Row="6" Col="1" Format="6"></Cell></Cells></MstGrid>
MSTGRID.WBT
;Winbatch 2009B - MstGrid - Free ActiveX Grid Control - ; tested on XP SP3 ; ;Download from: http://www.mysofttool.com ; ;The Exe file will create an MSTGrid folder in Program files and ;the .ocx will be registered there. The folder includes a help file ;and a grid designer. Use the Wil Viewer to obtain enumerations. ;Requires the VB6 runtime, which I think comes with XP ; ;This is a bare bones example. It loads data in XML ;format but you can copy/paste/insert/merge cells much like ;an Excel file. Cells are re-sizeable, and scroll bars work ; ;Stan Littlefield September 19, 2009 ;/////////////////////////////////////////////////////////////////////////////////////////// GoSub udfs ;this is important - prevents memory errors as the ;control is designed for VB6 SEM_FAILCRITICALERRORS = 1 SEM_NOGPFAULTERRORBOX = 2 SEM_NOOPENFILEERRORBOX = 32768 cXML=DirScript():"MstGridTest.xml" MSTFormat=`WWWDLGED,6.1` MSTCaption=`MstGrid Control` MSTX=9999 MSTY=9999 MSTWidth=202 MSTHeight=141 MSTNumControls=002 MSTProcedure=`dlgproc` MSTFont=`DEFAULT` MSTTextColor=`DEFAULT` MSTBackground=`DEFAULT,DEFAULT` MSTConfig=0 MST001=`003,005,192,112,COMCONTROL,DEFAULT,"MstGrid.grdView",DEFAULT,1,DEFAULT,DEFAULT,DEFAULT,DEFAULT` MST002=`013,121,166,012,PUSHBUTTON,DEFAULT,"Close and Exit",1,2,DEFAULT,DEFAULT,DEFAULT,DEFAULT` ButtonPushed=Dialog("MST") Exit ;/////////////////////////////////////////////////////////////////////////////////////////// :udfs #DefineSubRoutine dlgproc(handle,msg,id,p4,p5) Switch msg Case 0 ;Dialog Initialization IntControl(73,1,0,0,0) SetErrorMode(1|2|32768) DialogProcOptions(handle, 2,1) oGrid = DialogObject(handle,001,3) ;some idea of how to set grid up manually ;comment the section below to load a file ;then uncomment the next 7 lines ;oGrid.Appearance=1 ;oGrid.ColCount=2 ;oGrid.RowCount=100 ;oGrid.FixedCols=0 ;oGrid.FixedRows=0 ;oGrid.Backcolor=65000 ;oGrid.Refresh() ;if loading a file created with the MST designer oGrid.OpenFile(cXML) ;oGrid.FixedCols=0 ;oGrid.FixedRows=0 ;oGrid.PrintPreview() Return(-1) Break Case 2 Return(9) EndSwitch Return -2 :WBERRORHANDLER oGrid=0 ErrorProcessing(1,1,0,0) Exit #EndSubRoutine #DefineFunction SetErrorMode(nMode) sKernel32 = StrCat(DirWindows(1),"kernel32.dll") Return DllCall(sKernel32, long:"SetErrorMode", long:nMode) #EndFunction #DefineSubRoutine ErrorProcessing(deleteIni,showerr,logfile,Err_Array) If VarType(Err_Array) ==256 WbError = Err_Array[0] wberrorhandlerline = Err_Array[1] wberrorhandleroffset = Err_Array[2] wberrorhandlerassignment = Err_Array[3] wberrorhandlerfile = Err_Array[4] wberrortextstring = Err_Array[5] wberroradditionalinfo = Err_Array[6] wberrorinsegment = Err_Array[7] Else WbError = LastError() EndIf WbTextcode = WbError If WbError==1668||WbError==2669||WbError==3670 ; 1668 ; "Minor user-defined error" ; 2669 ; "Moderate user-defined error" ; 3670 ; "Severe user-defined error" WbError = ItemExtract(1,IntControl(34,-1,0,0,0),":") WbTextcode = -1 EndIf WbErrorString = IntControl(34,WbTextcode,0,0,0) WbErrorDateTime = TimeYmdHms() WbErrorFile = StrCat(DirWindows(0),"WWWBATCH.INI") If deleteIni FileDelete(WbErrorFile) IniWritePvt(WbErrorDateTime,"CurrentScript",WbErrorHandlerFile ,WbErrorFile) IniWritePvt(WbErrorDateTime,"ErrorValue" ,WbError ,WbErrorFile) IniWritePvt(WbErrorDateTime,"ErrorString" ,WbErrorString ,WbErrorFile) IniWritePvt(WbErrorDateTime,"ScriptLine" ,WbErrorHandlerLine ,WbErrorFile) IniWritePvt(WbErrorDateTime,"ScriptOffset" ,WbErrorHandlerOffset ,WbErrorFile) IniWritePvt(WbErrorDateTime,"VarAssignment",WbErrorHandlerAssignment,WbErrorFile) IniWritePvt(WbErrorDateTime,"VarInSegment" ,WbErrorInSegment,WbErrorFile) IniWritePvt("","","",WbErrorFile) EndIf WbErrorMsgText = StrCat(WbErrorDateTime,@CRLF) WbErrorMsgText = StrCat(WbErrorMsgText,"Current Script: ",WbErrorHandlerFile,@CRLF) WbErrorMsgText = StrCat(WbErrorMsgText,"Error# [",WbError,"]",@CRLF) WbErrorMsgText = StrCat(WbErrorMsgText,"Error Text: ",wberrortextstring,@CRLF) WbErrorMsgText = StrCat(WbErrorMsgText,"[Extended Information] ",wberroradditionalinfo,@CRLF,@CRLF) WbErrorMsgText = StrCat(WbErrorMsgText,"On Line:",@CRLF,WbErrorHandlerLine,@CRLF) ;WbErrorMsgText = StrCat(WbErrorMsgText,"Offset: ",WbErrorHandlerOffset,@CRLF) If (WbErrorHandlerAssignment>"") Then %WbErrorHandlerAssignment% = "UNKNOWN" WbErrorMsgText = StrCat(WbErrorMsgText,"Assignment/Variable: ",WbErrorHandlerAssignment,@CRLF) If (WbErrorInSegment>"") Then WbErrorMsgText = StrCat(WbErrorMsgText,"In UDF/UDS: ",WbErrorInSegment,@CRLF) If logfile cSep = StrCat(StrFill("=",50),@CRLF) cLogFile = StrCat(DirScript(),"log.err") If ! FileExist(cLogFile) Then FilePut(cLogFile,StrCat("Error Log",@CRLF,cSep)) FilePut(cLogFile,StrCat(FileGet(cLogFile),WbErrorMsgText,cSep)) Display(2,"An Error Occured",StrCat("written to ",cLogFile)) Else If showerr WbErrorMsgText = StrCat(WbErrorMsgText,"[THIS ERROR NOT WRITTEN TO LOG FILE]",@CRLF) Message("An Error Was Encountered",WbErrorMsgText) EndIf EndIf Return(1) #EndSubRoutine Return ;//////////////////////////////////////////////////////////////////////
Article ID: W17704
Filename: MstGrid ActiveX Control .txt
File Created: 2009:09:21:08:09:22
Last Updated: 2009:09:21:08:09:22