home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / sscont_1 / sscontro.ctl (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-01-13  |  87.8 KB  |  1,774 lines

  1. VERSION 5.00
  2. Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
  3. Begin VB.UserControl SScontrol 
  4.    Alignable       =   -1  'True
  5.    AutoRedraw      =   -1  'True
  6.    ClientHeight    =   960
  7.    ClientLeft      =   0
  8.    ClientTop       =   0
  9.    ClientWidth     =   1350
  10.    ControlContainer=   -1  'True
  11.    BeginProperty Font 
  12.       Name            =   "Courier New"
  13.       Size            =   8.25
  14.       Charset         =   0
  15.       Weight          =   400
  16.       Underline       =   0   'False
  17.       Italic          =   0   'False
  18.       Strikethrough   =   0   'False
  19.    EndProperty
  20.    ScaleHeight     =   960
  21.    ScaleWidth      =   1350
  22.    Begin VB.TextBox XXcellTextbox 
  23.       BorderStyle     =   0  'None
  24.       Height          =   285
  25.       Left            =   0
  26.       TabIndex        =   1
  27.       Text            =   "Text Control"
  28.       Top             =   630
  29.       Visible         =   0   'False
  30.       Width           =   1320
  31.    End
  32.    Begin MSFlexGridLib.MSFlexGrid XXgrid 
  33.       Height          =   615
  34.       Left            =   0
  35.       TabIndex        =   0
  36.       Top             =   0
  37.       Width           =   1320
  38.       _ExtentX        =   2328
  39.       _ExtentY        =   1085
  40.       _Version        =   65541
  41.       AllowBigSelection=   0   'False
  42.       ScrollTrack     =   -1  'True
  43.       FocusRect       =   2
  44.       AllowUserResizing=   3
  45.       FormatString    =   "col 1|col 2;row 1|row 2"
  46.    End
  47. Attribute VB_Name = "SScontrol"
  48. Attribute VB_GlobalNameSpace = False
  49. Attribute VB_Creatable = True
  50. Attribute VB_PredeclaredId = False
  51. Attribute VB_Exposed = True
  52. Option Explicit
  53. Option Compare Binary
  54. '******************************************************************************************
  55. ' This FREE control is intended to provide Active-X table creation and
  56. ' editing features to Web Browsers, without using either dynamic html or
  57. ' referencing version-specific libraries from Excel, etc.
  58. ' NO LIABILITY ACCEPTED OR SUPPORT OR WARRANTEE GIVEN.
  59. ' This FREE control can easily be used by your own VBscript programs
  60. ' (and probably Jscript too) and will work with both IE3 and IE4 and
  61. ' probably third party products which provide Active-X functionality to
  62. ' other browsers such as Netscape).
  63. ' A summary of functionality:
  64. '       1. in-cell user-editing of cell contents
  65. '       2. base-zero matrix cell referencing,
  66. '               eg controlname.TextMatrix(irow,icol)="fred"
  67. '       3. an InitializeSS method to quickly create a table with headings
  68. '       4. an AutoSizeSS method to automatically resize the control
  69. '          to the size of your table
  70. '       5. exposes ClearSS method to clear all table values
  71. '       6. exposes CellDataChange event to notify when a cell's value changes
  72. '       7. exposes standard MSFLEXGRID events:
  73. '               EnterCell(), LeaveCell(), RowColChange(), SelChange()
  74. '       8. exposes almost all other MSFLEXGRID properties
  75. ' Smart developers could, for example, use this control as a basis to
  76. ' create FREE simple spreadsheet-like functionality for Web Browsers
  77. ' in VBSCRIPT or JSCRIPT, without having to pay a thing or have the
  78. ' requirement to have Excel libraries or similar products pre-installed.
  79. ' Of course, those same people could implement such functionality within
  80. ' the FREE souce code provided here.
  81. ' The only limitation is that such extensions MUST also be provided to
  82. ' the world on a FREE non-commercial basis and include complete source code.
  83. ' This FREE Active-X control created with VB5-sp3 is a wrapper for the
  84. ' standard Microsoft MSFLEXGRID control provided by products such as
  85. ' VB5-sp3. Both controls are freely distributable given this has been
  86. ' created by a fully licensed VB user).  The documentation that applies
  87. ' to the MSFLEXGRID control also applies to this control.
  88. ' Remember that some property/method arguments have been
  89. ' made into VARIANT types so that they are accessible to
  90. ' the VBSCRIPT engine (which only uses variants).
  91. ' Also remember this is intended as a run-time control and as
  92. ' such no design-time properties are "remembered" at run-time.
  93. ' SUMMARY of METHODS/EVENTS/PROPERTIES:
  94. ' 1. Methods are usable within VBscript,  eg FRED.ClearSS
  95. '       Method InitializeSS(NoRows, NoCols, NoFixedRows, NoFixedCols, wantRowTotals, wantColTotals, numberVBformatString, theFontName, theFontSize, theMSFlexGridFormatString)
  96. '         NoRows = number of rows in the table (incl row headings)
  97. '         NoCols = number of rows in the table (incl col headings)
  98. '         NoFixedRows = number of heading rows
  99. '         NoFixedCols = number of heading columns
  100. '         wantRowTotals = true if want row total processing
  101. '         wantColTotals = true if want column total processing
  102. '         numberVBformatString = the VB "format string" for formatting numbers eg "###,###,##0.00"
  103. '         theFontName = font name string
  104. '         theFontSize = font size number
  105. '         theMSFlexGridFormatString = row/col heading/alignment format string
  106. '               MSFlexGrid parses the FormatString at design time and interprets
  107. '               it to get the following information: number of rows and columns, text
  108. '               for row and column headings, column width, and column alignment.
  109. '               The FormatString property is made up of segments separated by pipe
  110. '               characters ( | ). The text between pipes defines a column, and it may
  111. '               contain the special alignment characters <, ^, or >, to align the entire
  112. '               column to the left, center, or right. The text is assigned to row zero,
  113. '               and its width defines the width of each column.
  114. '               The FormatString may also contain a semi-colon (";"), which causes the
  115. '               remainder of the string to be interpreted as row heading and width
  116. '               information. The text is assigned to column zero, and the longest string
  117. '               defines the width of column zero.
  118. '               MSFlexGrid will create additional rows and columns to accommodate all
  119. '               fields defined by the FormatString, but it will not delete rows or columns
  120. '               if only a few fields are specified. If you want, you can do this by setting
  121. '               the Rows and Cols properties.
  122. '                 examples:
  123. '                 ' Set column headers:
  124. '                     "<Region  |<Product   |<Employee   |>Sales    "
  125. '                 ' Set row headers (note semicolon at start)
  126. '                     ";Name|Address|Telephone|Social Security#"
  127. '                 ' Set column and row headers.
  128. '                     "|Name|Address|Telephone|Social Security#;|Robert|Jimmy|Bonzo|John Paul"
  129. '       Method ClearSS()                      clear table values
  130. '       Method AutoSizeSS()                   resize control to size of table
  131. '       Method AddItem(Item, Optional Index)
  132. '       Method RemoveItem(Index)
  133. '       Method Refresh()                      refresh the table
  134. '       Method RecalculateTotals()            refresh table totals
  135. ' 2. Events are usable within VBscript by preceding the event
  136. '    name with "controlname_",
  137. '                               SUB FRED_EnterCell()
  138. '                                       'your processing such as
  139. '                                       irow = FRED.Row
  140. '                                       icol = FRED.Col
  141. '                                       ival = FRED.TextMatrix(irow,icol)
  142. '                               END SUB
  143. '       Event EnterCell()
  144. '       Event LeaveCell()
  145. '       Event RowColChange()
  146. '       Event SelChange()
  147. '       Event CellDataChange(theRow, theCol, PreChangeData, PostChangeData, ChangeSequenceNo)
  148. ' 3. Properties are usable within VBscript,  eg FRED.Width
  149. '          Property  Rows() As Long
  150. '          Attribute Rows.VB_Description = "Determines the total number of columns or rows in a FlexGrid."
  151. '          Property  Cols() As Long
  152. '          Attribute Cols.VB_Description = "Determines the total number of columns or rows in a FlexGrid."
  153. '          Property  Row() As Long
  154. '          Attribute Row.VB_Description = "Returns/sets the active cell in a FlexGrid. Not available at design time."
  155. '          Property  Col() As Long
  156. '          Attribute Col.VB_Description = "Returns/sets the active cell in a FlexGrid. Not available at design time."
  157. '          Property  TextMatrix(Row As Variant, Col As Variant) As String
  158. '          Attribute Text.VB_Description = "Returns/sets the value of the specified cell in a FlexGrid. Not available at design time."
  159. '          Property  Text() As String
  160. '          Attribute Text.VB_Description = "Returns/sets the value of the active cell in a FlexGrid. Not available at design time."
  161. '          Property  TextArray(Index As Variant) As String
  162. '          Attribute Text.VB_Description = "Returns/sets the value of the active cell in a FlexGrid. Not available at design time."
  163. '          Property  FixedRows() As Long
  164. '          Attribute FixedRows.VB_Description = "Returns/sets the total number of fixed (non-scrollable) columns or rows for a FlexGrid."
  165. '          Property  FixedCols() As Long
  166. '          Attribute FixedCols.VB_Description = "Returns/sets the total number of fixed (non-scrollable) columns or rows for a FlexGrid."
  167. '          Property  FormatString() As String
  168. '          Attribute FormatString.VB_Description = "Allows you to set up a FlexGrid's column widths, alignments, and fixed row and column text at design time. See the help file for details."
  169. '          Property  Font() As Font
  170. '          Attribute Font.VB_Description = "Returns/sets the default font Object attributes for individual cells."
  171. '          Property  RowIsVisible(Index As Variant) As Boolean
  172. '          Property  TopRow() As Long
  173. '          Attribute TopRow.VB_Description = "Returns/sets the uppermost row *displayed* in the FlexGrid. Not available at design time."
  174. '          Property  LeftCol() As Long
  175. '          Attribute LeftCol.VB_Description = "Returns/sets the leftmost visible column *displayed* (other than a fixed column) in the FlexGrid. Not available at design time."
  176. '          Property  AllowBigSelection() As Boolean
  177. '          Attribute AllowBigSelection.VB_Description = "Returns/sets whether clicking on a column or row header should cause the entire column or row to be selected."
  178. '          Property  AllowUserResizing() As AllowUserResizeSettings
  179. '          Attribute AllowUserResizing.VB_Description = "Returns/sets whether the user should be allowed to resize rows and columns with the mouse."
  180. '          Property  Appearance() As AppearanceSettings
  181. '          Attribute Appearance.VB_Description = "Returns/sets whether a control should be painted with 3-D effects."
  182. '          Property  CellAlignment() As Integer
  183. '          Attribute CellAlignment.VB_Description = "Returns/sets the alignment of data in a cell or range of selected cells. Not available at design time."
  184. '          Property  CellBackColor() As Long
  185. '          Attribute CellBackColor.VB_Description = "Returns/sets the background and foreground colors of individual cells or ranges of cells."
  186. '          Property  CellFontBold() As Boolean
  187. '          Attribute CellFontBold.VB_Description = "Returns or sets the bold style for the current cell text."
  188. '          Property  CellFontItalic() As Boolean
  189. '          Attribute CellFontItalic.VB_Description = "Returns or sets the italic style for the current cell text."
  190. '          Property  CellFontName() As String
  191. '          Attribute CellFontName.VB_Description = "Returns/sets the font to be used for individual cells or ranges of cells."
  192. '          Property  CellFontSize() As Single
  193. '          Attribute CellFontSize.VB_Description = "Returns or sets the size, in points, for the current cell text."
  194. '          Property  CellFontStrikeThrough() As Boolean
  195. '          Attribute CellFontStrikeThrough.VB_Description = "Returns or sets the strikethrough style for the current cell text."
  196. '          Property  CellFontUnderline() As Boolean
  197. '          Attribute CellFontUnderline.VB_Description = "Returns or sets the underline style for the current cell text."
  198. '          Property  CellFontWidth() As Single
  199. '          Attribute CellFontWidth.VB_Description = "Returns or sets the font width for the current cell text."
  200. '          Property  CellForeColor() As Long
  201. '          Attribute CellForeColor.VB_Description = "Returns/sets the background and foreground colors of individual cells or ranges of cells."
  202. '          Property  CellHeight() As Long
  203. '          Property  CellLeft() As Long
  204. '          Property  CellPicture() As Picture
  205. '          Attribute CellPicture.VB_Description = "Returns/sets an image to be displayed in the current cell or in a range of cells."
  206. '          Property  CellPictureAlignment() As Integer
  207. '          Attribute CellPictureAlignment.VB_Description = "Returns/sets the alignment of pictures in a cell or range of selected cells. Not available at design time."
  208. '          Property  CellTextStyle() As TextStyleSettings
  209. '          Attribute CellTextStyle.VB_Description = "Returns/sets 3D effects for text on a specific cell or range of cells."
  210. '          Property  CellTop() As Long
  211. '          Property  CellWidth() As Long
  212. '          Property  ColAlignment(Index As Variant) As Integer
  213. '          Property  ColAlignment(Index As Variant, ByVal New_ColAlignment As Integer)
  214. '          Attribute ColAlignment.VB_Description = "Returns/sets the alignment of data in a column. Not available at design time (except indirectly through the FormatString property)."
  215. '          Property  ColData(Index As Variant) As Long
  216. '          Attribute ColData.VB_Description = "Array of long integer values with one item for each row (RowData) and for each column (ColData) of the FlexGrid. Not available at design time."
  217. '          Property  ColIsVisible(Index As Variant) As Boolean
  218. '          Property  ColPos(Index As Variant) As Long
  219. '        COLPOSITION is LET only (no GET)
  220. '          Property  ColPosition(Index As Variant, ByVal New_ColPosition As Long)
  221. '          Property  ColSel() As Long
  222. '          Attribute ColSel.VB_Description = "Determines the starting or ending row or column for a range of cells. Not available at design time."
  223. '          Property  ColWidth(Index As Variant) As Long
  224. '          Attribute ColWidth.VB_Description = "Determines the width of the specified column in Twips. Not available at design time."
  225. '          Property  DataBindings() As DataBindings
  226. '          Property  DataSource() As IRowCursor
  227. '          Property  Enabled() As Boolean
  228. '          Attribute Enabled.VB_Description = "Returns/sets a value that determines whether an object can respond to user-generated events."
  229. '          Property  FillStyle() As FillStyleSettings
  230. '          Attribute FillStyle.VB_Description = "Determines whether setting the Text property or one of the Cell formatting properties of a FlexGrid applies the change to all selected cells."
  231. '          Property  FixedAlignment(Index As Variant) As Integer
  232. '          Attribute FixedAlignment.VB_Description = "Returns/sets the alignment of data in the fixed cells of a column."
  233. '          Property  FocusRect() As FocusRectSettings
  234. '          Attribute FocusRect.VB_Description = "Determines whether the FlexGrid control should draw a focus rectangle around the current cell."
  235. '          Property  FontWidth() As Single
  236. '          Attribute FontWidth.VB_Description = "Returns or sets the width, in points, of the font to be used for text displayed."
  237. '          Property  ForeColor() As OLE_COLOR
  238. '          Attribute ForeColor.VB_Description = "Determines the color used to draw text on each part of the FlexGrid."
  239. '          Property  ForeColorFixed() As Long
  240. '          Attribute ForeColorFixed.VB_Description = "Determines the color used to draw text on each part of the FlexGrid."
  241. '          Property  ForeColorSel() As Long
  242. '          Attribute ForeColorSel.VB_Description = "Determines the color used to draw text on each part of the FlexGrid."
  243. '          Property  GridColor() As Long
  244. '          Attribute GridColor.VB_Description = "Returns/sets the color used to draw the lines between FlexGrid cells."
  245. '          Property  GridColorFixed() As Long
  246. '          Attribute GridColorFixed.VB_Description = "Returns/sets the color used to draw the lines between FlexGrid cells."
  247. '          Property  GridLines() As GridLineSettings
  248. '          Attribute GridLines.VB_Description = "Returns/sets the type of lines that should be drawn between cells."
  249. '          Property  GridLinesFixed() As GridLineSettings
  250. '          Attribute GridLinesFixed.VB_Description = "Returns/sets the type of lines that should be drawn between cells."
  251. '          Property  GridLineWidth() As Integer
  252. '          Attribute GridLineWidth.VB_Description = "Returns/sets the width in Pixels of the gridlines for the control."
  253. '          Property  HaveColTotals() As Boolean
  254. '          Property  HaveRowTotals() As Boolean
  255. '          Property  HighLight() As HighLightSettings
  256. '          Attribute HighLight.VB_Description = "Returns/sets whether selected cells appear highlighted."
  257. '          Property  MergeCells() As MergeCellsSettings
  258. '          Attribute MergeCells.VB_Description = "Returns/sets whether cells with the same contents should be grouped in a single cell spanning multiple rows or columns."
  259. '          Property  MergeCol(Index As Variant) As Boolean
  260. '          Attribute MergeCol.VB_Description = "Returns/sets which rows (columns) should have their contents merged when the MergeCells property is set to a value other than 0 - Never."
  261. '          Property  MergeRow(Index As Variant) As Boolean
  262. '          Attribute MergeRow.VB_Description = "Returns/sets which rows (columns) should have their contents merged when the MergeCells property is set to a value other than 0 - Never."
  263. '          Property  MouseCol() As Long
  264. '          Property  Set MouseIcon(ByVal New_MouseIcon As Picture)
  265. '          Property  MousePointer() As MousePointerSettings
  266. '          Attribute MousePointer.VB_Description = "Returns/sets the type of mouse pointer displayed when over part of an object."
  267. '          Property  MouseRow() As Long
  268. '          Property  NumberVBformatString as String
  269. '          Property  Picture() As Picture
  270. '          Property  Redraw() As Boolean
  271. '          Attribute Redraw.VB_Description = "Enables or disables redrawing of the FlexGrid control."
  272. '          Property  RowData(Index As Variant) As Long
  273. '          Attribute RowData.VB_Description = "Array of long integer values with one item for each row (RowData) and for each column (ColData) of the FlexGrid. Not available at design time."
  274. '          Property  RowHeight(Index As Variant) As Long
  275. '          Attribute RowHeight.VB_Description = "Returns/sets the height of the specified row in Twips. Not available at design time."
  276. '          Property  RowHeightMin() As Long
  277. '          Attribute RowHeightMin.VB_Description = "Returns/sets a minimum row height for the entire control, in Twips."
  278. '          Property  RowPos(Index As Variant) As Long
  279. '         ROWPOSITION is SET only (no GET)
  280. '          Property  RowPosition(Index As Variant, ByVal New_RowPosition As Long)
  281. '          Property  RowSel() As Long
  282. '          Attribute RowSel.VB_Description = "Determines the starting or ending row or column for a range of cells. Not available at design time."
  283. '          Property  ScrollBars() As ScrollBarsSettings
  284. '          Attribute ScrollBars.VB_Description = "Returns/sets whether a FlexGrid has horizontal or vertical scroll bars."
  285. '          Property  ScrollTrack() As Boolean
  286. '          Attribute ScrollTrack.VB_Description = "Returns/sets whether FlexGrid should scroll its contents while the user moves the scroll box along the scroll bars."
  287. '         SORT is SET only (no GET)
  288. '          Property  Sort(ByVal New_Sort As Variant)
  289. '          Property  TextStyle() As TextStyleSettings
  290. '          Attribute TextStyle.VB_Description = "Returns/sets 3D effects for displaying text."
  291. '          Property  TextStyleFixed() As TextStyleSettings
  292. '          Attribute TextStyleFixed.VB_Description = "Returns/sets 3D effects for displaying text."
  293. '          Property  ToolTipText() As String
  294. '          Attribute ToolTipText.VB_Description = "Returns/sets the text displayed when the mouse is paused over the control."
  295. '          Property  Version() As Integer
  296. '          Attribute Version.VB_Description = "Returns the version of the FlexGrid control currently loaded in memory."
  297. '          Property  WordWrap() As Boolean
  298. '          Property  Width() As Double
  299. '          Property  Height() As Double
  300. '******************************************************************************************
  301. Private PreEditCellData As String
  302. Private EditSequenceNo As Long
  303. 'Default Property Values:
  304. 'Property Variables:
  305. Private pHaveRowTotals As Boolean
  306. Private pHaveColTotals As Boolean
  307. Private pNumberVBformatString As String
  308. 'Event Declarations:
  309. 'Event Compare(Row1 As Long, Row2 As Long, Cmp As Integer) 'MappingInfo=XXgrid,XXgrid,-1,Compare
  310. Event EnterCell() 'MappingInfo=XXgrid,XXgrid,-1,EnterCell
  311. Event LeaveCell() 'MappingInfo=XXgrid,XXgrid,-1,LeaveCell
  312. Event RowColChange() 'MappingInfo=XXgrid,XXgrid,-1,RowColChange
  313. Event SelChange() 'MappingInfo=XXgrid,XXgrid,-1,SelChange
  314. Event CellDataChange(theRow As Long, theCol As Long, PreChangeData As String, PostChangeData As String, SequenceNo As Long)     'MappingInfo=XXgrid,XXgrid,-1,CellDataChange
  315. Public Sub ClearSS()
  316.   XXgrid.Clear
  317. End Sub
  318. Public Sub AutoSizeSS()
  319. Dim i, j, lw As Double, lh As Double, gw As Double, gh As Double
  320.   DoEvents
  321.   gw = XXgrid.GridLineWidth * Screen.TwipsPerPixelX
  322.   If XXgrid.Cols < 11 Then gw = gw * 2
  323.   gh = XXgrid.GridLineWidth * Screen.TwipsPerPixelY
  324.   lw = 36 + gw + 36
  325.   lh = 31 + gh + 31
  326.   For i = 0 To XXgrid.Rows - 1
  327.     lh = lh + XXgrid.RowHeight(i) + XXgrid.GridLineWidth
  328.   Next
  329.   For j = 0 To XXgrid.Cols - 1
  330.     lw = lw + XXgrid.ColWidth(j) + XXgrid.GridLineWidth
  331.   Next
  332.   UserControl.Width = lw
  333.   UserControl.Height = lh
  334. 'UserControl_Resize gets automatically called by changing these
  335.   DoEvents
  336. End Sub
  337. Private Sub UserControl_Initialize()
  338.   PreEditCellData = ""
  339.   EditSequenceNo = 0
  340.   pHaveRowTotals = False
  341.   pHaveColTotals = False
  342.   pNumberVBformatString = "###,###,###,##0.00"
  343. End Sub
  344. Public Sub InitializeSS(NRows As Variant, NCols As Variant, NFixedRows As Variant, NFixedCols As Variant, wantRowTotals As Variant, wantColTotals As Variant, NumberVBformatString As Variant, theFontName As Variant, theFontSize As Variant, theMSFlexGridFormatString As Variant)
  345. '  MsgBox "InitializeSS(" & NRows & "," & NCols & "," & NFixedRows & "," & NFixedCols & "," & wantRowTotals & "," & wantColTotals & "," & NumberVBformatString & "," & theFontName & "," & theFontSize & "," & theMSFlexGridFormatString & ")"
  346.   PreEditCellData = ""
  347.   EditSequenceNo = 0
  348. ' Always (re)set to zero to avoid errors when fixedrows >= rows
  349.   XXgrid.Clear
  350.   XXgrid.FormatString = ""
  351.   XXgrid.FixedRows = 0
  352.   XXgrid.FixedCols = 0
  353.   XXgrid.Rows = 0
  354.   XXgrid.Cols = 0
  355.   UserControl.Font.Name = theFontName
  356.   UserControl.Font.Size = theFontSize
  357.   Call SyncFonts
  358.   PropertyChanged "Font"
  359.   XXgrid.Rows = NRows
  360.   PropertyChanged "Rows"
  361.   XXgrid.Cols = NCols
  362.   PropertyChanged "Cols"
  363.   XXgrid.FixedRows = NFixedRows
  364.   PropertyChanged "FixedRows"
  365.   XXgrid.FixedCols = NFixedCols
  366.   PropertyChanged "FixedCols"
  367.   XXgrid.FormatString = theMSFlexGridFormatString
  368.   PropertyChanged "FormatString"
  369.   XXgrid.Refresh
  370.   Call UserControl_Resize
  371.   XXcellTextbox.Text = ""
  372.   pHaveRowTotals = wantRowTotals
  373.   PropertyChanged "HaveRowTotals"
  374.   pHaveColTotals = wantColTotals
  375.   PropertyChanged "HaveColTotals"
  376.   pNumberVBformatString = NumberVBformatString
  377.   PropertyChanged "NumberVBformatString"
  378.   Call ZeroRowColumnTotals
  379.   DoEvents
  380. End Sub
  381. Private Sub XXgrid_DblClick()
  382.    XXgridEdit Asc(" ")
  383. End Sub
  384. Private Sub XXgrid_KeyPress(KeyAscii As Integer)
  385. Dim irow As Long, icol As Long, old_text As String
  386.    Select Case KeyAscii
  387.       Case vbKeyBack          'backspace
  388.         irow = XXgrid.Row
  389.         icol = XXgrid.Col
  390.         old_text = XXgrid.TextMatrix(irow, icol)
  391.         XXgrid.TextMatrix(irow, icol) = ""
  392.         Call ProcessCellDataChange(irow, icol, old_text, "")
  393.       Case Else
  394.         XXgridEdit KeyAscii
  395.     End Select
  396. End Sub
  397. Private Sub XXgridEdit(KeyAscii As Integer)
  398. 'For demonstration purposes, the Case statement in the XXgridEdit
  399. 'routine shows two different behaviors when entering the edit
  400. 'mode. In practice you would probably only use one of them, or
  401. 'a different one of your own creation. If the edit mode is
  402. 'entered by virtue of a double-click or a control key preXXgrid,
  403. 'we copy the contents of the grid cell to the exit box and
  404. 'place the cursor at the end of the string. If the edit mode
  405. 'is entered by pressing a normal key, we ignore the original
  406. 'cell contents and insert the pressed key into the edit box.
  407. 'The positioning of the exit box could be done on one line
  408. 'with the Move method. Here we have used four lines so that
  409. 'it reads more easily in this article. Notice that
  410. 'MSFlexGrid conveniently gives us all the coordinate
  411. 'information we need.
  412.    'use correct font
  413. '   XXcellTextbox.FontName = XXgrid.FontName
  414. '   XXcellTextbox.FontSize = XXgrid.FontSize
  415.    Select Case KeyAscii
  416.       Case 0 To Asc(" ")
  417.          XXcellTextbox.Text = XXgrid.Text
  418.          XXcellTextbox.SelStart = 1000
  419.       Case Else
  420.          XXcellTextbox.Text = Chr(KeyAscii)
  421.          XXcellTextbox.SelStart = 1
  422.    End Select
  423.    PreEditCellData = XXgrid.Text
  424. 'position the edit box
  425.    XXcellTextbox.Left = XXgrid.CellLeft + XXgrid.Left
  426.    XXcellTextbox.Top = XXgrid.CellTop + XXgrid.Top
  427.    XXcellTextbox.Width = XXgrid.CellWidth
  428.    XXcellTextbox.Height = XXgrid.CellHeight
  429.    XXcellTextbox.Visible = True
  430.    XXcellTextbox.SetFocus
  431. End Sub
  432. Private Sub ProcessCellDataChange(theRow As Long, theCol As Long, PreChangeData As String, PostChangeData As String)
  433. 'Before raising the Event, check for and update totals
  434.   If IsNumeric(PostChangeData) And (theRow >= XXgrid.FixedRows And theCol >= XXgrid.FixedCols) Then
  435.     XXgrid.TextMatrix(theRow, theCol) = Format$(CDbl(PostChangeData), pNumberVBformatString)
  436.   End If
  437.   Call SumTheQuickWay(theRow, theCol, PreChangeData, PostChangeData)
  438.   RaiseEvent CellDataChange(theRow, theCol, PreChangeData, PostChangeData, EditSequenceNo)
  439.   EditSequenceNo = EditSequenceNo + 1
  440.   PreEditCellData = PostChangeData ' so no cascaded events
  441. End Sub
  442. Public Sub ZeroRowColumnTotals()
  443.   Dim i As Long, j As Long
  444.     If pHaveRowTotals Then
  445.       For i = XXgrid.FixedRows To ((XXgrid.Rows - 1) - 1)
  446.         XXgrid.TextMatrix(i, (XXgrid.Cols - 1)) = Format$(0#, pNumberVBformatString)
  447.       Next
  448.     End If
  449.     If pHaveColTotals Then
  450.       For j = XXgrid.FixedCols To ((XXgrid.Cols - 1) - 1)
  451.         XXgrid.TextMatrix((XXgrid.Rows - 1), j) = Format$(0#, pNumberVBformatString)
  452.       Next
  453.     End If
  454.     If pHaveRowTotals Or pHaveColTotals Then
  455.       XXgrid.TextMatrix(XXgrid.Rows - 1, XXgrid.Cols - 1) = Format$(0#, pNumberVBformatString)
  456.     End If
  457. End Sub
  458. Private Sub SumTheQuickWay(theRow As Long, theCol As Long, PreChangeData As String, PostChangeData As String)
  459. ' (do it the quick but messy way)
  460. ' Assume everything starts out as pre-calculated and all OK (it this won't work)
  461.   Dim iTotalForRow As Long
  462.   Dim jTotalForRow As Long
  463.   Dim iTotalForCol As Long
  464.   Dim jTotalForCol As Long
  465.   Dim iGT As Long
  466.   Dim jGT As Long
  467.   Dim TotalForRow As Double
  468.   Dim TotalForCol As Double
  469.   Dim GT As Double
  470.   Dim v As Double
  471.   If (pHaveRowTotals Or pHaveColTotals) And (theRow >= XXgrid.FixedRows And theCol >= XXgrid.FixedCols) Then
  472.     MousePointer = vbHourglass
  473.     v = 0#
  474.     If IsNumeric(PostChangeData) Then v = CDbl(PostChangeData)
  475.     iTotalForRow = theRow
  476.     jTotalForRow = XXgrid.Cols - 1
  477.     iTotalForCol = XXgrid.Rows - 1
  478.     jTotalForCol = theCol
  479.     iGT = XXgrid.Rows - 1
  480.     jGT = XXgrid.Cols - 1
  481.     If Not IsNumeric(XXgrid.TextMatrix(iTotalForRow, jTotalForRow)) Then
  482.       TotalForRow = 0#
  483.     Else
  484.       TotalForRow = CDbl(XXgrid.TextMatrix(iTotalForRow, jTotalForRow))
  485.     End If
  486.     If Not IsNumeric(XXgrid.TextMatrix(iTotalForCol, jTotalForCol)) Then
  487.       TotalForCol = 0#
  488.     Else
  489.       TotalForCol = CDbl(XXgrid.TextMatrix(iTotalForCol, jTotalForCol))
  490.     End If
  491.     If Not IsNumeric(XXgrid.TextMatrix(iGT, jGT)) Then
  492.       GT = 0#
  493.     Else
  494.       GT = CDbl(XXgrid.TextMatrix(iGT, jGT))
  495.     End If
  496.     If IsNumeric(PreChangeData) Then
  497.       TotalForRow = TotalForRow - CDbl(PreChangeData)
  498.       TotalForCol = TotalForCol - CDbl(PreChangeData)
  499.       GT = GT - CDbl(PreChangeData)
  500.     End If
  501.     XXgrid.TextMatrix(iTotalForRow, jTotalForRow) = Format$(TotalForRow + v, pNumberVBformatString)
  502.     XXgrid.TextMatrix(iTotalForCol, jTotalForCol) = Format$(TotalForCol + v, pNumberVBformatString)
  503.     XXgrid.TextMatrix(iGT, jGT) = Format$(GT + v, pNumberVBformatString)
  504.     MousePointer = vbDefault
  505.   End If
  506. End Sub
  507. Public Sub RecalculateTotals()
  508. ' (do it the long and hard way - parse whole table every time)
  509.   Dim i As Long, j As Long
  510.   Dim v As Double, GrandTotal As Double
  511.   'If (pHaveRowTotals Or pHaveColTotals) And (theRow >= XXgrid.FixedRows And theCol >= XXgrid.FixedCols) Then
  512.   If pHaveRowTotals Or pHaveColTotals Then
  513.     MousePointer = vbHourglass
  514.     ReDim TotalsForEachCol(XXgrid.FixedCols To ((XXgrid.Cols - 1) - 1)) As Double
  515.     GrandTotal = 0
  516.     For j = XXgrid.FixedCols To ((XXgrid.Cols - 1) - 1)
  517.       TotalsForEachCol(j) = 0#
  518.     Next
  519.     ReDim TotalsForEachRow(XXgrid.FixedRows To ((XXgrid.Rows - 1) - 1)) As Double
  520.     For i = XXgrid.FixedRows To ((XXgrid.Rows - 1) - 1)
  521.       TotalsForEachRow(i) = 0#
  522.     Next
  523.     For i = XXgrid.FixedRows To ((XXgrid.Rows - 1) - 1)
  524.       For j = XXgrid.FixedCols To ((XXgrid.Cols - 1) - 1)
  525.         If IsNumeric(XXgrid.TextMatrix(i, j)) Then
  526.           v = CDbl(XXgrid.TextMatrix(i, j))
  527.           TotalsForEachRow(i) = TotalsForEachRow(i) + v
  528.           TotalsForEachCol(j) = TotalsForEachCol(j) + v
  529.           GrandTotal = GrandTotal + v
  530.         End If
  531.       Next
  532.     Next
  533.     If pHaveRowTotals Then
  534.       For i = XXgrid.FixedRows To ((XXgrid.Rows - 1) - 1)
  535.         XXgrid.TextMatrix(i, (XXgrid.Cols - 1)) = Format$(TotalsForEachRow(i), pNumberVBformatString)
  536.       Next
  537.     End If
  538.     If pHaveColTotals Then
  539.       For j = XXgrid.FixedCols To ((XXgrid.Cols - 1) - 1)
  540.         XXgrid.TextMatrix((XXgrid.Rows - 1), j) = Format$(TotalsForEachCol(j), pNumberVBformatString)
  541.       Next
  542.     End If
  543.     XXgrid.TextMatrix(XXgrid.Rows - 1, XXgrid.Cols - 1) = Format$(GrandTotal, pNumberVBformatString)
  544.     Erase TotalsForEachCol, TotalsForEachRow
  545.     MousePointer = vbDefault
  546.   End If
  547. End Sub
  548. Private Sub XXgrid_LeaveCell()
  549. Dim the_row As Long, the_col As Long
  550.    the_row = XXgrid.Row
  551.    the_col = XXgrid.Col
  552.    If XXcellTextbox.Visible Then
  553.       XXgrid.Text = XXcellTextbox.Text
  554.       If PreEditCellData <> XXcellTextbox.Text Then
  555.         Call ProcessCellDataChange(the_row, the_col, PreEditCellData, XXcellTextbox.Text)
  556.       End If
  557.       XXcellTextbox.Visible = False
  558.    End If
  559.   RaiseEvent LeaveCell
  560. End Sub
  561. Private Sub XXgrid_GotFocus()
  562. Dim the_row As Long, the_col As Long
  563.    the_row = XXgrid.Row
  564.    the_col = XXgrid.Col
  565.    If XXcellTextbox.Visible Then
  566.       XXgrid.Text = XXcellTextbox.Text
  567.       XXcellTextbox.Visible = False
  568.       If PreEditCellData <> XXcellTextbox.Text Then
  569.         Call ProcessCellDataChange(the_row, the_col, PreEditCellData, XXcellTextbox.Text)
  570.       End If
  571.    End If
  572. End Sub
  573. Private Sub XXcellTextbox_KeyDown(KeyCode As Integer, Shift As Integer)
  574.    Select Case KeyCode
  575.       Case vbKeyEscape    'escape
  576.          XXcellTextbox.Visible = False
  577.          XXgrid.SetFocus
  578.       Case vbKeyReturn    'enter
  579.          XXgrid.SetFocus
  580.       Case vbKeyDown      'down arrow
  581.          XXgrid.SetFocus
  582.          DoEvents
  583.          If XXgrid.Row < XXgrid.Rows - 1 Then
  584.             XXgrid.Row = XXgrid.Row + 1     ' do the move regardless
  585.             If WillOverwriteTotals(XXgrid.Row, XXgrid.Col) Then 'backout if gone too far
  586.               XXgrid.Row = XXgrid.Row - 1
  587.             End If
  588.          End If
  589.       Case vbKeyUp      'up arrow
  590.          XXgrid.SetFocus
  591.          DoEvents
  592.          If XXgrid.Row > XXgrid.FixedRows Then
  593.             XXgrid.Row = XXgrid.Row - 1
  594.          End If
  595.    End Select
  596. End Sub
  597. Private Sub XXcellTextbox_KeyPress(KeyAscii As Integer)
  598. 'we need a line of code to suppress the Beep that
  599. 'occurs when the Enter key is pressed in a Textbox
  600.    'noise suppression
  601.    If KeyAscii = vbKeyReturn Then KeyAscii = 0
  602. End Sub
  603. Private Sub UserControl_Resize()
  604. ' Size the SS control external size to fit it's container
  605. ' - it generates own internal scollbars if necessary !
  606.   DoEvents
  607.   XXgrid.Move 0, 0, UserControl.ScaleWidth, UserControl.ScaleHeight
  608.   DoEvents
  609. End Sub
  610. Private Function WillOverwriteTotals(irow As Long, icol As Long)
  611. ' Check that a proposed update does not impinge on row/col totals
  612.   WillOverwriteTotals = False
  613.   If pHaveRowTotals Then
  614.     If (irow >= XXgrid.FixedRows) And (icol = XXgrid.Cols - 1) Then
  615.       WillOverwriteTotals = True
  616.     End If
  617.   End If
  618.   If pHaveColTotals Then
  619.     If (icol >= XXgrid.FixedCols) And (irow = XXgrid.Rows - 1) Then
  620.       WillOverwriteTotals = True
  621.     End If
  622.   End If
  623. End Function
  624. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  625. 'MappingInfo=XXgrid,XXgrid,-1,HaveRowTotals
  626. Public Property Get HaveRowTotals() As Boolean
  627.   HaveRowTotals = pHaveRowTotals
  628. End Property
  629. Public Property Let HaveRowTotals(ByVal New_HaveRowTotals As Boolean)
  630.   pHaveRowTotals = New_HaveRowTotals
  631.   If pHaveRowTotals Then Call RecalculateTotals
  632.   PropertyChanged "HaveRowTotals"
  633. End Property
  634. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  635. 'MappingInfo=XXgrid,XXgrid,-1,HaveColTotals
  636. Public Property Get HaveColTotals() As Boolean
  637.   HaveColTotals = pHaveColTotals
  638. End Property
  639. Public Property Let HaveColTotals(ByVal New_HaveColTotals As Boolean)
  640.   pHaveColTotals = New_HaveColTotals
  641.   If pHaveColTotals Then Call RecalculateTotals
  642.   PropertyChanged "HaveColTotals"
  643. End Property
  644. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  645. 'MappingInfo=XXgrid,XXgrid,-1,NumberVBformatString
  646. Public Property Get NumberVBformatString() As String
  647.   NumberVBformatString = pNumberVBformatString
  648. End Property
  649. Public Property Let NumberVBformatString(New_NumberVBformatString As String)
  650.   pNumberVBformatString = New_NumberVBformatString
  651.   PropertyChanged "NumberVBformatString"
  652. End Property
  653. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  654. 'MappingInfo=XXgrid,XXgrid,-1,AddItem
  655. 'Public Sub AddItem(Item As String, Optional Index As Variant)
  656. Public Sub AddItem(Item As Variant, Optional Index As Variant)
  657.   XXgrid.AddItem Item, Index
  658. End Sub
  659. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  660. 'MappingInfo=XXgrid,XXgrid,-1,AllowBigSelection
  661. Public Property Get AllowBigSelection() As Boolean
  662. Attribute AllowBigSelection.VB_Description = "Returns/sets whether clicking on a column or row header should cause the entire column or row to be selected."
  663.   AllowBigSelection = XXgrid.AllowBigSelection
  664. End Property
  665. Public Property Let AllowBigSelection(ByVal New_AllowBigSelection As Boolean)
  666.   XXgrid.AllowBigSelection = New_AllowBigSelection
  667.   PropertyChanged "AllowBigSelection"
  668. End Property
  669. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  670. 'MappingInfo=XXgrid,XXgrid,-1,AllowUserResizing
  671. Public Property Get AllowUserResizing() As AllowUserResizeSettings
  672. Attribute AllowUserResizing.VB_Description = "Returns/sets whether the user should be allowed to resize rows and columns with the mouse."
  673.   AllowUserResizing = XXgrid.AllowUserResizing
  674. End Property
  675. Public Property Let AllowUserResizing(ByVal New_AllowUserResizing As AllowUserResizeSettings)
  676.   XXgrid.AllowUserResizing = New_AllowUserResizing
  677.   PropertyChanged "AllowUserResizing"
  678. End Property
  679. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  680. 'MappingInfo=XXgrid,XXgrid,-1,Appearance
  681. Public Property Get Appearance() As AppearanceSettings
  682. Attribute Appearance.VB_Description = "Returns/sets whether a control should be painted with 3-D effects."
  683.   Appearance = XXgrid.Appearance
  684. End Property
  685. Public Property Let Appearance(ByVal New_Appearance As AppearanceSettings)
  686.   XXgrid.Appearance = New_Appearance
  687.   PropertyChanged "Appearance"
  688. End Property
  689. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  690. 'MappingInfo=XXgrid,XXgrid,-1,CellAlignment
  691. Public Property Get CellAlignment() As Integer
  692. Attribute CellAlignment.VB_Description = "Returns/sets the alignment of data in a cell or range of selected cells. Not available at design time."
  693.   CellAlignment = XXgrid.CellAlignment
  694. End Property
  695. Public Property Let CellAlignment(ByVal New_CellAlignment As Integer)
  696.   XXgrid.CellAlignment = New_CellAlignment
  697.   PropertyChanged "CellAlignment"
  698. End Property
  699. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  700. 'MappingInfo=XXgrid,XXgrid,-1,CellBackColor
  701. Public Property Get CellBackColor() As Long
  702. Attribute CellBackColor.VB_Description = "Returns/sets the background and foreground colors of individual cells or ranges of cells."
  703.   CellBackColor = XXgrid.CellBackColor
  704. End Property
  705. Public Property Let CellBackColor(ByVal New_CellBackColor As Long)
  706.   XXgrid.CellBackColor = New_CellBackColor
  707.   PropertyChanged "CellBackColor"
  708. End Property
  709. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  710. 'MappingInfo=XXgrid,XXgrid,-1,CellFontBold
  711. Public Property Get CellFontBold() As Boolean
  712. Attribute CellFontBold.VB_Description = "Returns or sets the bold style for the current cell text."
  713.   CellFontBold = XXgrid.CellFontBold
  714. End Property
  715. Public Property Let CellFontBold(ByVal New_CellFontBold As Boolean)
  716.   XXgrid.CellFontBold = New_CellFontBold
  717.   PropertyChanged "CellFontBold"
  718. End Property
  719. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  720. 'MappingInfo=XXgrid,XXgrid,-1,CellFontItalic
  721. Public Property Get CellFontItalic() As Boolean
  722. Attribute CellFontItalic.VB_Description = "Returns or sets the italic style for the current cell text."
  723.   CellFontItalic = XXgrid.CellFontItalic
  724. End Property
  725. Public Property Let CellFontItalic(ByVal New_CellFontItalic As Boolean)
  726.   XXgrid.CellFontItalic = New_CellFontItalic
  727.   PropertyChanged "CellFontItalic"
  728. End Property
  729. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  730. 'MappingInfo=XXgrid,XXgrid,-1,CellFontName
  731. Public Property Get CellFontName() As String
  732. Attribute CellFontName.VB_Description = "Returns/sets the font to be used for individual cells or ranges of cells."
  733.   CellFontName = XXgrid.CellFontName
  734. End Property
  735. Public Property Let CellFontName(ByVal New_CellFontName As String)
  736.   XXgrid.CellFontName = New_CellFontName
  737.   PropertyChanged "CellFontName"
  738. End Property
  739. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  740. 'MappingInfo=XXgrid,XXgrid,-1,CellFontSize
  741. Public Property Get CellFontSize() As Single
  742. Attribute CellFontSize.VB_Description = "Returns or sets the size, in points, for the current cell text."
  743.   CellFontSize = XXgrid.CellFontSize
  744. End Property
  745. Public Property Let CellFontSize(ByVal New_CellFontSize As Single)
  746.   XXgrid.CellFontSize = New_CellFontSize
  747.   PropertyChanged "CellFontSize"
  748. End Property
  749. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  750. 'MappingInfo=XXgrid,XXgrid,-1,CellFontStrikeThrough
  751. Public Property Get CellFontStrikeThrough() As Boolean
  752. Attribute CellFontStrikeThrough.VB_Description = "Returns or sets the strikethrough style for the current cell text."
  753.   CellFontStrikeThrough = XXgrid.CellFontStrikeThrough
  754. End Property
  755. Public Property Let CellFontStrikeThrough(ByVal New_CellFontStrikeThrough As Boolean)
  756.   XXgrid.CellFontStrikeThrough = New_CellFontStrikeThrough
  757.   PropertyChanged "CellFontStrikeThrough"
  758. End Property
  759. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  760. 'MappingInfo=XXgrid,XXgrid,-1,CellFontUnderline
  761. Public Property Get CellFontUnderline() As Boolean
  762. Attribute CellFontUnderline.VB_Description = "Returns or sets the underline style for the current cell text."
  763.   CellFontUnderline = XXgrid.CellFontUnderline
  764. End Property
  765. Public Property Let CellFontUnderline(ByVal New_CellFontUnderline As Boolean)
  766.   XXgrid.CellFontUnderline = New_CellFontUnderline
  767.   PropertyChanged "CellFontUnderline"
  768. End Property
  769. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  770. 'MappingInfo=XXgrid,XXgrid,-1,CellFontWidth
  771. Public Property Get CellFontWidth() As Single
  772. Attribute CellFontWidth.VB_Description = "Returns or sets the font width for the current cell text."
  773.   CellFontWidth = XXgrid.CellFontWidth
  774. End Property
  775. Public Property Let CellFontWidth(ByVal New_CellFontWidth As Single)
  776.   XXgrid.CellFontWidth = New_CellFontWidth
  777.   PropertyChanged "CellFontWidth"
  778. End Property
  779. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  780. 'MappingInfo=XXgrid,XXgrid,-1,CellForeColor
  781. Public Property Get CellForeColor() As Long
  782. Attribute CellForeColor.VB_Description = "Returns/sets the background and foreground colors of individual cells or ranges of cells."
  783.   CellForeColor = XXgrid.CellForeColor
  784. End Property
  785. Public Property Let CellForeColor(ByVal New_CellForeColor As Long)
  786.   XXgrid.CellForeColor = New_CellForeColor
  787.   PropertyChanged "CellForeColor"
  788. End Property
  789. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  790. 'MappingInfo=XXgrid,XXgrid,-1,CellHeight
  791. Public Property Get CellHeight() As Long
  792.   CellHeight = XXgrid.CellHeight
  793. End Property
  794. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  795. 'MappingInfo=XXgrid,XXgrid,-1,CellLeft
  796. Public Property Get CellLeft() As Long
  797.   CellLeft = XXgrid.CellLeft
  798. End Property
  799. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  800. 'MappingInfo=XXgrid,XXgrid,-1,CellPicture
  801. Public Property Get CellPicture() As Picture
  802. Attribute CellPicture.VB_Description = "Returns/sets an image to be displayed in the current cell or in a range of cells."
  803.   Set CellPicture = XXgrid.CellPicture
  804. End Property
  805. Public Property Set CellPicture(ByVal New_CellPicture As Picture)
  806.   Set XXgrid.CellPicture = New_CellPicture
  807.   PropertyChanged "CellPicture"
  808. End Property
  809. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  810. 'MappingInfo=XXgrid,XXgrid,-1,CellPictureAlignment
  811. Public Property Get CellPictureAlignment() As Integer
  812. Attribute CellPictureAlignment.VB_Description = "Returns/sets the alignment of pictures in a cell or range of selected cells. Not available at design time."
  813.   CellPictureAlignment = XXgrid.CellPictureAlignment
  814. End Property
  815. Public Property Let CellPictureAlignment(ByVal New_CellPictureAlignment As Integer)
  816.   XXgrid.CellPictureAlignment = New_CellPictureAlignment
  817.   PropertyChanged "CellPictureAlignment"
  818. End Property
  819. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  820. 'MappingInfo=XXgrid,XXgrid,-1,CellTextStyle
  821. Public Property Get CellTextStyle() As TextStyleSettings
  822. Attribute CellTextStyle.VB_Description = "Returns/sets 3D effects for text on a specific cell or range of cells."
  823.   CellTextStyle = XXgrid.CellTextStyle
  824. End Property
  825. Public Property Let CellTextStyle(ByVal New_CellTextStyle As TextStyleSettings)
  826.   XXgrid.CellTextStyle = New_CellTextStyle
  827.   PropertyChanged "CellTextStyle"
  828. End Property
  829. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  830. 'MappingInfo=XXgrid,XXgrid,-1,CellTop
  831. Public Property Get CellTop() As Long
  832.   CellTop = XXgrid.CellTop
  833. End Property
  834. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  835. 'MappingInfo=XXgrid,XXgrid,-1,CellWidth
  836. Public Property Get CellWidth() As Long
  837.   CellWidth = XXgrid.CellWidth
  838. End Property
  839. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  840. 'MappingInfo=XXgrid,XXgrid,-1,Col
  841. Public Property Get Col() As Long
  842. Attribute Col.VB_Description = "Returns/sets the active cell in a FlexGrid. Not available at design time."
  843.   Col = XXgrid.Col
  844. End Property
  845. Public Property Let Col(ByVal New_Col As Long)
  846.   XXgrid.Col = New_Col
  847.   PropertyChanged "Col"
  848. End Property
  849. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  850. 'MappingInfo=XXgrid,XXgrid,-1,ColAlignment
  851. 'Public Property Get ColAlignment(Index As Long) As Integer
  852. Public Property Get ColAlignment(Index As Variant) As Integer
  853.   ColAlignment = XXgrid.ColAlignment(Index)
  854. End Property
  855. 'Public Property Let ColAlignment(Index As Long, ByVal New_ColAlignment As Integer)
  856. Public Property Let ColAlignment(Index As Variant, ByVal New_ColAlignment As Integer)
  857. Attribute ColAlignment.VB_Description = "Returns/sets the alignment of data in a column. Not available at design time (except indirectly through the FormatString property)."
  858.   XXgrid.ColAlignment(Index) = New_ColAlignment
  859.   PropertyChanged "ColAlignment"
  860. End Property
  861. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  862. 'MappingInfo=XXgrid,XXgrid,-1,ColData
  863. 'Public Property Get ColData(Index As Long) As Long
  864. Public Property Get ColData(Index As Variant) As Long
  865. Attribute ColData.VB_Description = "Array of long integer values with one item for each row (RowData) and for each column (ColData) of the FlexGrid. Not available at design time."
  866.   ColData = XXgrid.ColData(Index)
  867. End Property
  868. 'Public Property Let ColData(Index As Long, ByVal New_ColData As Long)
  869. Public Property Let ColData(Index As Variant, ByVal New_ColData As Long)
  870.   XXgrid.ColData(Index) = New_ColData
  871.   PropertyChanged "ColData"
  872. End Property
  873. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  874. 'MappingInfo=XXgrid,XXgrid,-1,ColIsVisible
  875. 'Public Property Get ColIsVisible(Index As Long) As Boolean
  876. Public Property Get ColIsVisible(Index As Variant) As Boolean
  877.   ColIsVisible = XXgrid.ColIsVisible(Index)
  878. End Property
  879. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  880. 'MappingInfo=XXgrid,XXgrid,-1,ColPos
  881. 'Public Property Get ColPos(Index As Long) As Long
  882. Public Property Get ColPos(Index As Variant) As Long
  883.   ColPos = XXgrid.ColPos(Index)
  884. End Property
  885. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  886. 'MappingInfo=XXgrid,XXgrid,-1,ColPosition
  887. 'Public Property Get ColPosition(Index As Long) As Long
  888. '  ColPosition = XXgrid.ColPosition(Index)
  889. 'End Property
  890. ' COLPOSITION is LET only (no GET)
  891. 'Public Property Let ColPosition(Index As Long, ByVal New_ColPosition As Long)
  892. Public Property Let ColPosition(Index As Variant, ByVal New_ColPosition As Long)
  893.   XXgrid.ColPosition(Index) = New_ColPosition
  894.   PropertyChanged "ColPosition"
  895. End Property
  896. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  897. 'MappingInfo=XXgrid,XXgrid,-1,Cols
  898. Public Property Get Cols() As Long
  899. Attribute Cols.VB_Description = "Determines the total number of columns or rows in a FlexGrid."
  900.   Cols = XXgrid.Cols
  901. End Property
  902. Public Property Let Cols(ByVal New_Cols As Long)
  903.   XXgrid.Cols = New_Cols
  904.   PropertyChanged "Cols"
  905. End Property
  906. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  907. 'MappingInfo=XXgrid,XXgrid,-1,ColSel
  908. Public Property Get ColSel() As Long
  909. Attribute ColSel.VB_Description = "Determines the starting or ending row or column for a range of cells. Not available at design time."
  910.   ColSel = XXgrid.ColSel
  911. End Property
  912. Public Property Let ColSel(ByVal New_ColSel As Long)
  913.   XXgrid.ColSel = New_ColSel
  914.   PropertyChanged "ColSel"
  915. End Property
  916. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  917. 'MappingInfo=XXgrid,XXgrid,-1,ColWidth
  918. 'Public Property Get ColWidth(Index As Long) As Long
  919. Public Property Get ColWidth(Index As Variant) As Long
  920.   ColWidth = XXgrid.ColWidth(Index)
  921. End Property
  922. 'Public Property Let ColWidth(Index As Long, ByVal New_ColWidth As Long)
  923. Public Property Let ColWidth(Index As Variant, ByVal New_ColWidth As Long)
  924. Attribute ColWidth.VB_Description = "Determines the width of the specified column in Twips. Not available at design time."
  925.   XXgrid.ColWidth(Index) = New_ColWidth
  926.   PropertyChanged "ColWidth"
  927. End Property
  928. 'Private Sub XXgrid_Compare(Row1 As Long, Row2 As Long, Cmp As Integer)
  929. '  RaiseEvent Compare(Row1, Row2, Cmp)
  930. 'End Sub
  931. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  932. 'MappingInfo=XXgrid,XXgrid,-1,DataBindings
  933. Public Property Get DataBindings() As DataBindings
  934.   Set DataBindings = XXgrid.DataBindings
  935. End Property
  936. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  937. 'MappingInfo=XXgrid,XXgrid,-1,DataSource
  938. Public Property Get DataSource() As IRowCursor
  939.   Set DataSource = XXgrid.DataSource
  940. End Property
  941. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  942. 'MappingInfo=XXgrid,XXgrid,-1,Enabled
  943. Public Property Get Enabled() As Boolean
  944. Attribute Enabled.VB_Description = "Returns/sets a value that determines whether an object can respond to user-generated events."
  945.   Enabled = XXgrid.Enabled
  946. End Property
  947. Public Property Let Enabled(ByVal New_Enabled As Boolean)
  948.   XXgrid.Enabled = New_Enabled
  949.   PropertyChanged "Enabled"
  950. End Property
  951. Private Sub XXgrid_EnterCell()
  952.   If pHaveRowTotals And (XXgrid.Col >= XXgrid.Cols - 1) Then
  953.     XXgrid.Col = XXgrid.Col - 1
  954.   End If
  955.   If pHaveColTotals And (XXgrid.Row >= XXgrid.Rows - 1) Then
  956.     XXgrid.Row = XXgrid.Row - 1
  957.   End If
  958.   RaiseEvent EnterCell
  959. End Sub
  960. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  961. 'MappingInfo=XXgrid,XXgrid,-1,FillStyle
  962. Public Property Get FillStyle() As FillStyleSettings
  963. Attribute FillStyle.VB_Description = "Determines whether setting the Text property or one of the Cell formatting properties of a FlexGrid applies the change to all selected cells."
  964.   FillStyle = XXgrid.FillStyle
  965. End Property
  966. Public Property Let FillStyle(ByVal New_FillStyle As FillStyleSettings)
  967.   XXgrid.FillStyle = New_FillStyle
  968.   PropertyChanged "FillStyle"
  969. End Property
  970. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  971. 'MappingInfo=XXgrid,XXgrid,-1,FixedAlignment
  972. 'Public Property Get FixedAlignment(Index As Long) As Integer
  973. Public Property Get FixedAlignment(Index As Variant) As Integer
  974.   FixedAlignment = XXgrid.FixedAlignment(Index)
  975. End Property
  976. 'Public Property Let FixedAlignment(Index As Long, ByVal New_FixedAlignment As Integer)
  977. Public Property Let FixedAlignment(Index As Variant, ByVal New_FixedAlignment As Integer)
  978. Attribute FixedAlignment.VB_Description = "Returns/sets the alignment of data in the fixed cells of a column."
  979.   XXgrid.FixedAlignment(Index) = New_FixedAlignment
  980.   PropertyChanged "FixedAlignment"
  981. End Property
  982. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  983. 'MappingInfo=XXgrid,XXgrid,-1,FixedCols
  984. Public Property Get FixedCols() As Long
  985. Attribute FixedCols.VB_Description = "Returns/sets the total number of fixed (non-scrollable) columns or rows for a FlexGrid."
  986.   FixedCols = XXgrid.FixedCols
  987. End Property
  988. Public Property Let FixedCols(ByVal New_FixedCols As Long)
  989.   XXgrid.FixedCols = New_FixedCols
  990.   PropertyChanged "FixedCols"
  991. End Property
  992. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  993. 'MappingInfo=XXgrid,XXgrid,-1,FixedRows
  994. Public Property Get FixedRows() As Long
  995. Attribute FixedRows.VB_Description = "Returns/sets the total number of fixed (non-scrollable) columns or rows for a FlexGrid."
  996.   FixedRows = XXgrid.FixedRows
  997. End Property
  998. Public Property Let FixedRows(ByVal New_FixedRows As Long)
  999.   XXgrid.FixedRows = New_FixedRows
  1000.   PropertyChanged "FixedRows"
  1001. End Property
  1002. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1003. 'MappingInfo=XXgrid,XXgrid,-1,FocusRect
  1004. Public Property Get FocusRect() As FocusRectSettings
  1005. Attribute FocusRect.VB_Description = "Determines whether the FlexGrid control should draw a focus rectangle around the current cell."
  1006.   FocusRect = XXgrid.FocusRect
  1007. End Property
  1008. Public Property Let FocusRect(ByVal New_FocusRect As FocusRectSettings)
  1009.   XXgrid.FocusRect = New_FocusRect
  1010.   PropertyChanged "FocusRect"
  1011. End Property
  1012. Public Property Get Font() As Font
  1013. Attribute Font.VB_Description = "Returns/sets the default font or the font for individual cells."
  1014.   Set Font = UserControl.Font
  1015. End Property
  1016. Public Property Set Font(ByVal New_Font As Font)
  1017.   Set UserControl.Font = New_Font
  1018.   Call SyncFonts
  1019.   PropertyChanged "Font"
  1020. End Property
  1021. Private Sub SyncFonts()
  1022.   Set XXgrid.Font = UserControl.Font
  1023.   Set XXcellTextbox.Font = UserControl.Font
  1024.   DoEvents
  1025. End Sub
  1026. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1027. 'MappingInfo=XXgrid,XXgrid,-1,FontWidth
  1028. Public Property Get FontWidth() As Single
  1029. Attribute FontWidth.VB_Description = "Returns or sets the width, in points, of the font to be used for text displayed."
  1030.   FontWidth = XXgrid.FontWidth
  1031. End Property
  1032. Public Property Let FontWidth(ByVal New_FontWidth As Single)
  1033.   XXgrid.FontWidth = New_FontWidth
  1034.   PropertyChanged "FontWidth"
  1035. End Property
  1036. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1037. 'MappingInfo=XXgrid,XXgrid,-1,ForeColor
  1038. Public Property Get ForeColor() As OLE_COLOR
  1039. Attribute ForeColor.VB_Description = "Determines the color used to draw text on each part of the FlexGrid."
  1040.   ForeColor = XXgrid.ForeColor
  1041. End Property
  1042. Public Property Let ForeColor(ByVal New_ForeColor As OLE_COLOR)
  1043.   XXgrid.ForeColor = New_ForeColor
  1044.   PropertyChanged "ForeColor"
  1045. End Property
  1046. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1047. 'MappingInfo=XXgrid,XXgrid,-1,ForeColorFixed
  1048. Public Property Get ForeColorFixed() As Long
  1049. Attribute ForeColorFixed.VB_Description = "Determines the color used to draw text on each part of the FlexGrid."
  1050.   ForeColorFixed = XXgrid.ForeColorFixed
  1051. End Property
  1052. Public Property Let ForeColorFixed(ByVal New_ForeColorFixed As Long)
  1053.   XXgrid.ForeColorFixed = New_ForeColorFixed
  1054.   PropertyChanged "ForeColorFixed"
  1055. End Property
  1056. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1057. 'MappingInfo=XXgrid,XXgrid,-1,ForeColorSel
  1058. Public Property Get ForeColorSel() As Long
  1059. Attribute ForeColorSel.VB_Description = "Determines the color used to draw text on each part of the FlexGrid."
  1060.   ForeColorSel = XXgrid.ForeColorSel
  1061. End Property
  1062. Public Property Let ForeColorSel(ByVal New_ForeColorSel As Long)
  1063.   XXgrid.ForeColorSel = New_ForeColorSel
  1064.   PropertyChanged "ForeColorSel"
  1065. End Property
  1066. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1067. 'MappingInfo=XXgrid,XXgrid,-1,FormatString
  1068. Public Property Get FormatString() As String
  1069. Attribute FormatString.VB_Description = "Allows you to set up a FlexGrid's column widths, alignments, and fixed row and column text at design time. See the help file for details."
  1070.   FormatString = XXgrid.FormatString
  1071. End Property
  1072. Public Property Let FormatString(ByVal New_FormatString As String)
  1073.   XXgrid.FormatString = New_FormatString
  1074.   PropertyChanged "FormatString"
  1075. End Property
  1076. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1077. 'MappingInfo=XXgrid,XXgrid,-1,GridColor
  1078. Public Property Get GridColor() As Long
  1079. Attribute GridColor.VB_Description = "Returns/sets the color used to draw the lines between FlexGrid cells."
  1080.   GridColor = XXgrid.GridColor
  1081. End Property
  1082. Public Property Let GridColor(ByVal New_GridColor As Long)
  1083.   XXgrid.GridColor = New_GridColor
  1084.   PropertyChanged "GridColor"
  1085. End Property
  1086. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1087. 'MappingInfo=XXgrid,XXgrid,-1,GridColorFixed
  1088. Public Property Get GridColorFixed() As Long
  1089. Attribute GridColorFixed.VB_Description = "Returns/sets the color used to draw the lines between FlexGrid cells."
  1090.   GridColorFixed = XXgrid.GridColorFixed
  1091. End Property
  1092. Public Property Let GridColorFixed(ByVal New_GridColorFixed As Long)
  1093.   XXgrid.GridColorFixed = New_GridColorFixed
  1094.   PropertyChanged "GridColorFixed"
  1095. End Property
  1096. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1097. 'MappingInfo=XXgrid,XXgrid,-1,GridLines
  1098. Public Property Get GridLines() As GridLineSettings
  1099. Attribute GridLines.VB_Description = "Returns/sets the type of lines that should be drawn between cells."
  1100.   GridLines = XXgrid.GridLines
  1101. End Property
  1102. Public Property Let GridLines(ByVal New_GridLines As GridLineSettings)
  1103.   XXgrid.GridLines = New_GridLines
  1104.   PropertyChanged "GridLines"
  1105. End Property
  1106. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1107. 'MappingInfo=XXgrid,XXgrid,-1,GridLinesFixed
  1108. Public Property Get GridLinesFixed() As GridLineSettings
  1109. Attribute GridLinesFixed.VB_Description = "Returns/sets the type of lines that should be drawn between cells."
  1110.   GridLinesFixed = XXgrid.GridLinesFixed
  1111. End Property
  1112. Public Property Let GridLinesFixed(ByVal New_GridLinesFixed As GridLineSettings)
  1113.   XXgrid.GridLinesFixed = New_GridLinesFixed
  1114.   PropertyChanged "GridLinesFixed"
  1115. End Property
  1116. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1117. 'MappingInfo=XXgrid,XXgrid,-1,GridLineWidth
  1118. Public Property Get GridLineWidth() As Integer
  1119. Attribute GridLineWidth.VB_Description = "Returns/sets the width in Pixels of the gridlines for the control."
  1120.   GridLineWidth = XXgrid.GridLineWidth
  1121. End Property
  1122. Public Property Let GridLineWidth(ByVal New_GridLineWidth As Integer)
  1123.   XXgrid.GridLineWidth = New_GridLineWidth
  1124.   PropertyChanged "GridLineWidth"
  1125. End Property
  1126. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1127. 'MappingInfo=XXgrid,XXgrid,-1,HighLight
  1128. Public Property Get HighLight() As HighLightSettings
  1129. Attribute HighLight.VB_Description = "Returns/sets whether selected cells appear highlighted."
  1130.   HighLight = XXgrid.HighLight
  1131. End Property
  1132. Public Property Let HighLight(ByVal New_HighLight As HighLightSettings)
  1133.   XXgrid.HighLight = New_HighLight
  1134.   PropertyChanged "HighLight"
  1135. End Property
  1136. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1137. 'MappingInfo=XXgrid,XXgrid,-1,LeftCol
  1138. Public Property Get LeftCol() As Long
  1139. Attribute LeftCol.VB_Description = "Returns/sets the leftmost visible column (other than a fixed column) in the FlexGrid. Not available at design time."
  1140.   LeftCol = XXgrid.LeftCol
  1141. End Property
  1142. Public Property Let LeftCol(ByVal New_LeftCol As Long)
  1143.   XXgrid.LeftCol = New_LeftCol
  1144.   PropertyChanged "LeftCol"
  1145. End Property
  1146. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1147. 'MappingInfo=XXgrid,XXgrid,-1,MergeCells
  1148. Public Property Get MergeCells() As MergeCellsSettings
  1149. Attribute MergeCells.VB_Description = "Returns/sets whether cells with the same contents should be grouped in a single cell spanning multiple rows or columns."
  1150.   MergeCells = XXgrid.MergeCells
  1151. End Property
  1152. Public Property Let MergeCells(ByVal New_MergeCells As MergeCellsSettings)
  1153.   XXgrid.MergeCells = New_MergeCells
  1154.   PropertyChanged "MergeCells"
  1155. End Property
  1156. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1157. 'MappingInfo=XXgrid,XXgrid,-1,MergeCol
  1158. 'Public Property Get MergeCol(Index As Long) As Boolean
  1159. Public Property Get MergeCol(Index As Variant) As Boolean
  1160. Attribute MergeCol.VB_Description = "Returns/sets which rows (columns) should have their contents merged when the MergeCells property is set to a value other than 0 - Never."
  1161.   MergeCol = XXgrid.MergeCol(Index)
  1162. End Property
  1163. 'Public Property Let MergeCol(Index As Long, ByVal New_MergeCol As Boolean)
  1164. Public Property Let MergeCol(Index As Variant, ByVal New_MergeCol As Boolean)
  1165.   XXgrid.MergeCol(Index) = New_MergeCol
  1166.   PropertyChanged "MergeCol"
  1167. End Property
  1168. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1169. 'MappingInfo=XXgrid,XXgrid,-1,MergeRow
  1170. 'Public Property Get MergeRow(Index As Long) As Boolean
  1171. Public Property Get MergeRow(Index As Variant) As Boolean
  1172. Attribute MergeRow.VB_Description = "Returns/sets which rows (columns) should have their contents merged when the MergeCells property is set to a value other than 0 - Never."
  1173.   MergeRow = XXgrid.MergeRow(Index)
  1174. End Property
  1175. 'Public Property Let MergeRow(Index As Long, ByVal New_MergeRow As Boolean)
  1176. Public Property Let MergeRow(Index As Variant, ByVal New_MergeRow As Boolean)
  1177.   XXgrid.MergeRow(Index) = New_MergeRow
  1178.   PropertyChanged "MergeRow"
  1179. End Property
  1180. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1181. 'MappingInfo=XXgrid,XXgrid,-1,MouseCol
  1182. Public Property Get MouseCol() As Long
  1183.   Set MouseIcon = XXgrid.MouseIcon
  1184. End Property
  1185. Public Property Set MouseIcon(ByVal New_MouseIcon As Picture)
  1186.   Set XXgrid.MouseIcon = New_MouseIcon
  1187.   PropertyChanged "MouseIcon"
  1188. End Property
  1189. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1190. 'MappingInfo=XXgrid,XXgrid,-1,MousePointer
  1191. Public Property Get MousePointer() As MousePointerSettings
  1192. Attribute MousePointer.VB_Description = "Returns/sets the type of mouse pointer displayed when over part of an object."
  1193.   MousePointer = XXgrid.MousePointer
  1194. End Property
  1195. Public Property Let MousePointer(ByVal New_MousePointer As MousePointerSettings)
  1196.   XXgrid.MousePointer = New_MousePointer
  1197.   PropertyChanged "MousePointer"
  1198. End Property
  1199. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1200. 'MappingInfo=XXgrid,XXgrid,-1,MouseRow
  1201. Public Property Get MouseRow() As Long
  1202.   MouseRow = XXgrid.MouseRow
  1203. End Property
  1204. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1205. 'MappingInfo=XXgrid,XXgrid,-1,Picture
  1206. Public Property Get Picture() As Picture
  1207.   Set Picture = XXgrid.Picture
  1208. End Property
  1209. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1210. 'MappingInfo=XXgrid,XXgrid,-1,Redraw
  1211. Public Property Get Redraw() As Boolean
  1212. Attribute Redraw.VB_Description = "Enables or disables redrawing of the FlexGrid control."
  1213.   Redraw = XXgrid.Redraw
  1214. End Property
  1215. Public Property Let Redraw(ByVal New_Redraw As Boolean)
  1216.   XXgrid.Redraw = New_Redraw
  1217.   PropertyChanged "Redraw"
  1218. End Property
  1219. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1220. 'MappingInfo=XXgrid,XXgrid,-1,Refresh
  1221. Public Sub Refresh()
  1222. Attribute Refresh.VB_Description = "Forces a complete repaint of a form or control."
  1223.   XXgrid.Refresh
  1224. End Sub
  1225. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1226. 'MappingInfo=XXgrid,XXgrid,-1,RemoveItem
  1227. 'Public Sub RemoveItem(Index As Long)
  1228. Public Sub RemoveItem(Index As Variant)
  1229.   XXgrid.RemoveItem Index
  1230. End Sub
  1231. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1232. 'MappingInfo=XXgrid,XXgrid,-1,Row
  1233. Public Property Get Row() As Long
  1234. Attribute Row.VB_Description = "Returns/sets the active cell in a FlexGrid. Not available at design time."
  1235.   Row = XXgrid.Row
  1236. End Property
  1237. Public Property Let Row(ByVal New_Row As Long)
  1238.   XXgrid.Row = New_Row
  1239.   PropertyChanged "Row"
  1240. End Property
  1241. Private Sub XXgrid_RowColChange()
  1242.   RaiseEvent RowColChange
  1243. End Sub
  1244. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1245. 'MappingInfo=XXgrid,XXgrid,-1,RowData
  1246. 'Public Property Get RowData(Index As Long) As Long
  1247. Public Property Get RowData(Index As Variant) As Long
  1248. Attribute RowData.VB_Description = "Array of long integer values with one item for each row (RowData) and for each column (ColData) of the FlexGrid. Not available at design time."
  1249.   RowData = XXgrid.RowData(Index)
  1250. End Property
  1251. 'Public Property Let RowData(Index As Long, ByVal New_RowData As Long)
  1252. Public Property Let RowData(Index As Variant, ByVal New_RowData As Long)
  1253.   XXgrid.RowData(Index) = New_RowData
  1254.   PropertyChanged "RowData"
  1255. End Property
  1256. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1257. 'MappingInfo=XXgrid,XXgrid,-1,RowHeight
  1258. 'Public Property Get RowHeight(Index As Long) As Long
  1259. Public Property Get RowHeight(Index As Variant) As Long
  1260. Attribute RowHeight.VB_Description = "Returns/sets the height of the specified row in Twips. Not available at design time."
  1261.   RowHeight = XXgrid.RowHeight(Index)
  1262. End Property
  1263. 'Public Property Let RowHeight(Index As Long, ByVal New_RowHeight As Long)
  1264. Public Property Let RowHeight(Index As Variant, ByVal New_RowHeight As Long)
  1265.   XXgrid.RowHeight(Index) = New_RowHeight
  1266.   PropertyChanged "RowHeight"
  1267. End Property
  1268. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1269. 'MappingInfo=XXgrid,XXgrid,-1,RowHeightMin
  1270. Public Property Get RowHeightMin() As Long
  1271. Attribute RowHeightMin.VB_Description = "Returns/sets a minimum row height for the entire control, in Twips."
  1272.   RowHeightMin = XXgrid.RowHeightMin
  1273. End Property
  1274. Public Property Let RowHeightMin(ByVal New_RowHeightMin As Long)
  1275.   XXgrid.RowHeightMin = New_RowHeightMin
  1276.   PropertyChanged "RowHeightMin"
  1277. End Property
  1278. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1279. 'MappingInfo=XXgrid,XXgrid,-1,RowIsVisible
  1280. 'Public Property Get RowIsVisible(Index As Long) As Boolean
  1281. Public Property Get RowIsVisible(Index As Variant) As Boolean
  1282.   RowIsVisible = XXgrid.RowIsVisible(Index)
  1283. End Property
  1284. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1285. 'MappingInfo=XXgrid,XXgrid,-1,RowPos
  1286. 'Public Property Get RowPos(Index As Long) As Long
  1287. Public Property Get RowPos(Index As Variant) As Long
  1288.   RowPos = XXgrid.RowPos(Index)
  1289. End Property
  1290. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1291. 'MappingInfo=XXgrid,XXgrid,-1,RowPosition
  1292. 'Public Property Get RowPosition(Index As Long) As Long
  1293. '  RowPosition = XXgrid.RowPosition(Index)
  1294. 'End Property
  1295. ' ROWPOSITION is SET only (no GET)
  1296. 'Public Property Let RowPosition(Index As Long, ByVal New_RowPosition As Long)
  1297. Public Property Let RowPosition(Index As Variant, ByVal New_RowPosition As Long)
  1298.   XXgrid.RowPosition(Index) = New_RowPosition
  1299.   PropertyChanged "RowPosition"
  1300. End Property
  1301. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1302. 'MappingInfo=XXgrid,XXgrid,-1,Rows
  1303. Public Property Get Rows() As Long
  1304. Attribute Rows.VB_Description = "Determines the total number of columns or rows in a FlexGrid."
  1305.   Rows = XXgrid.Rows
  1306. End Property
  1307. Public Property Let Rows(ByVal New_Rows As Long)
  1308.   XXgrid.Rows = New_Rows
  1309.   PropertyChanged "Rows"
  1310. End Property
  1311. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1312. 'MappingInfo=XXgrid,XXgrid,-1,RowSel
  1313. Public Property Get RowSel() As Long
  1314. Attribute RowSel.VB_Description = "Determines the starting or ending row or column for a range of cells. Not available at design time."
  1315.   RowSel = XXgrid.RowSel
  1316. End Property
  1317. Public Property Let RowSel(ByVal New_RowSel As Long)
  1318.   XXgrid.RowSel = New_RowSel
  1319.   PropertyChanged "RowSel"
  1320. End Property
  1321. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1322. 'MappingInfo=XXgrid,XXgrid,-1,ScrollBars
  1323. Public Property Get ScrollBars() As ScrollBarsSettings
  1324. Attribute ScrollBars.VB_Description = "Returns/sets whether a FlexGrid has horizontal or vertical scroll bars."
  1325.   ScrollBars = XXgrid.ScrollBars
  1326. End Property
  1327. Public Property Let ScrollBars(ByVal New_ScrollBars As ScrollBarsSettings)
  1328.   XXgrid.ScrollBars = New_ScrollBars
  1329.   PropertyChanged "ScrollBars"
  1330. End Property
  1331. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1332. 'MappingInfo=XXgrid,XXgrid,-1,ScrollTrack
  1333. Public Property Get ScrollTrack() As Boolean
  1334. Attribute ScrollTrack.VB_Description = "Returns/sets whether FlexGrid should scroll its contents while the user moves the scroll box along the scroll bars."
  1335.   ScrollTrack = XXgrid.ScrollTrack
  1336. End Property
  1337. Public Property Let ScrollTrack(ByVal New_ScrollTrack As Boolean)
  1338.   XXgrid.ScrollTrack = New_ScrollTrack
  1339.   PropertyChanged "ScrollTrack"
  1340. End Property
  1341. Private Sub XXgrid_SelChange()
  1342.   RaiseEvent SelChange
  1343. End Sub
  1344. ''WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1345. ''MappingInfo=XXgrid,XXgrid,-1,Text
  1346. Public Property Get Text() As String
  1347.   Text = XXgrid.Text
  1348. End Property
  1349. Public Property Let Text(ByVal New_Text As String)
  1350. Dim old_text As String, proposed_text As String, the_row As Long, the_col As Long
  1351.   the_row = XXgrid.Row
  1352.   the_col = XXgrid.Col
  1353.   If WillOverwriteTotals(the_row, the_col) Then
  1354.     Exit Property
  1355.   End If
  1356.   old_text = XXgrid.Text
  1357.   proposed_text = New_Text
  1358.   XXgrid.Text = New_Text
  1359.   PropertyChanged "Text"
  1360. '  If old_text <> proposed_text Then
  1361.     Call ProcessCellDataChange(the_row, the_col, old_text, proposed_text)
  1362. '  End If
  1363. End Property
  1364. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1365. 'MappingInfo=XXgrid,XXgrid,-1,TextArray
  1366. 'Public Property Get TextArray(Index As Long) As String
  1367. Public Property Get TextArray(Index As Variant) As String
  1368.   TextArray = XXgrid.TextArray(Index)
  1369. End Property
  1370. 'Public Property Let TextArray(Index As Long, ByVal New_TextArray As String)
  1371. Public Property Let TextArray(Index As Variant, ByVal New_TextArray As String)
  1372. Dim old_text As String, proposed_text As String, the_row As Long, the_col As Long
  1373.   the_row = Int(Index / XXgrid.Cols)
  1374.   the_col = Index - (the_row * XXgrid.Cols)
  1375.   If WillOverwriteTotals(the_row, the_col) Then
  1376.     Exit Property
  1377.   End If
  1378.   old_text = XXgrid.TextArray(Index)
  1379.   proposed_text = New_TextArray
  1380.   XXgrid.TextArray(Index) = New_TextArray
  1381.   PropertyChanged "TextArray"
  1382. '  If old_text <> proposed_text Then
  1383.     Call ProcessCellDataChange(the_row, the_col, old_text, proposed_text)
  1384. '  End If
  1385. End Property
  1386. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1387. 'MappingInfo=XXgrid,XXgrid,-1,Sort
  1388. ' SORT is SET only (no GET)
  1389. 'Public Property Get Sort() As Integer
  1390. '  Sort = XXgrid.Sort
  1391. 'End Property
  1392. 'Public Property Let Sort(ByVal New_Sort As Integer)
  1393. Public Property Let Sort(ByVal New_Sort As Variant)
  1394.   XXgrid.Sort = New_Sort
  1395.   PropertyChanged "Sort"
  1396. End Property
  1397. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1398. 'MappingInfo=XXgrid,XXgrid,-1,TextMatrix
  1399. 'Public Property Get TextMatrix(Row As Long, Col As Long) As String
  1400. Public Property Get TextMatrix(Row As Variant, Col As Variant) As String
  1401.   TextMatrix = XXgrid.TextMatrix(Row, Col)
  1402. End Property
  1403. 'Public Property Let TextMatrix(Row As Variant, Col As Variant, ByVal New_TextMatrix As String)
  1404. Public Property Let TextMatrix(Row As Variant, Col As Variant, ByVal New_TextMatrix As String)
  1405. Dim old_text As String, proposed_text As String, the_row As Long, the_col As Long
  1406.   the_row = Row
  1407.   the_col = Col
  1408.   If WillOverwriteTotals(the_row, the_col) Then
  1409.     Exit Property
  1410.   End If
  1411.   old_text = XXgrid.TextMatrix(Row, Col)
  1412.   proposed_text = New_TextMatrix
  1413.   XXgrid.TextMatrix(Row, Col) = New_TextMatrix
  1414.   PropertyChanged "TextMatrix"
  1415. '  If old_text <> proposed_text Then
  1416.     Call ProcessCellDataChange(the_row, the_col, old_text, proposed_text)
  1417. '  End If
  1418. End Property
  1419. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1420. 'MappingInfo=XXgrid,XXgrid,-1,TextStyle
  1421. Public Property Get TextStyle() As TextStyleSettings
  1422. Attribute TextStyle.VB_Description = "Returns/sets 3D effects for displaying text."
  1423.   TextStyle = XXgrid.TextStyle
  1424. End Property
  1425. Public Property Let TextStyle(ByVal New_TextStyle As TextStyleSettings)
  1426.   XXgrid.TextStyle = New_TextStyle
  1427.   PropertyChanged "TextStyle"
  1428. End Property
  1429. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1430. 'MappingInfo=XXgrid,XXgrid,-1,TextStyleFixed
  1431. Public Property Get TextStyleFixed() As TextStyleSettings
  1432. Attribute TextStyleFixed.VB_Description = "Returns/sets 3D effects for displaying text."
  1433.   TextStyleFixed = XXgrid.TextStyleFixed
  1434. End Property
  1435. Public Property Let TextStyleFixed(ByVal New_TextStyleFixed As TextStyleSettings)
  1436.   XXgrid.TextStyleFixed = New_TextStyleFixed
  1437.   PropertyChanged "TextStyleFixed"
  1438. End Property
  1439. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1440. 'MappingInfo=XXgrid,XXgrid,-1,ToolTipText
  1441. Public Property Get ToolTipText() As String
  1442. Attribute ToolTipText.VB_Description = "Returns/sets the text displayed when the mouse is paused over the control."
  1443.   ToolTipText = XXgrid.ToolTipText
  1444. End Property
  1445. Public Property Let ToolTipText(ByVal New_ToolTipText As String)
  1446.   XXgrid.ToolTipText = New_ToolTipText
  1447.   PropertyChanged "ToolTipText"
  1448. End Property
  1449. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1450. 'MappingInfo=XXgrid,XXgrid,-1,TopRow
  1451. Public Property Get TopRow() As Long
  1452. Attribute TopRow.VB_Description = "Returns/sets the uppermost row displayed in the FlexGrid. Not available at design time."
  1453.   TopRow = XXgrid.TopRow
  1454. End Property
  1455. Public Property Let TopRow(ByVal New_TopRow As Long)
  1456.   XXgrid.TopRow = New_TopRow
  1457.   PropertyChanged "TopRow"
  1458. End Property
  1459. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1460. 'MappingInfo=XXgrid,XXgrid,-1,Version
  1461. Public Property Get Version() As Integer
  1462. Attribute Version.VB_Description = "Returns the version of the FlexGrid control currently loaded in memory."
  1463.   Version = XXgrid.Version
  1464. End Property
  1465. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1466. 'MappingInfo=XXgrid,XXgrid,-1,WordWrap
  1467. Public Property Get WordWrap() As Boolean
  1468.   WordWrap = XXgrid.WordWrap
  1469. End Property
  1470. Public Property Let WordWrap(ByVal New_WordWrap As Boolean)
  1471.   XXgrid.WordWrap = New_WordWrap
  1472.   PropertyChanged "WordWrap"
  1473. End Property
  1474. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1475. 'MappingInfo=XXgrid,XXgrid,-1,Width
  1476. Public Property Get Width() As Double
  1477.   Width = UserControl.Width
  1478. End Property
  1479. Public Property Let Width(ByVal New_Width As Double)
  1480.   UserControl.Width = New_Width
  1481.   PropertyChanged "Width"
  1482. End Property
  1483. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  1484. 'MappingInfo=XXgrid,XXgrid,-1,Height
  1485. Public Property Get Height() As Double
  1486.   Height = UserControl.Height
  1487. End Property
  1488. Public Property Let Height(ByVal New_Height As Double)
  1489.   UserControl.Height = New_Height
  1490.   PropertyChanged "Height"
  1491. End Property
  1492. 'Initialize Properties for User Control
  1493. Private Sub UserControl_InitProperties()
  1494.   PreEditCellData = ""
  1495.   EditSequenceNo = 0
  1496.   pHaveRowTotals = False
  1497.   pHaveColTotals = False
  1498. End Sub
  1499. 'Load property values from storage
  1500. Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
  1501. Dim Index As Integer
  1502. Dim irow, icol
  1503. '  XXgrid.AllowBigSelection = PropBag.ReadProperty("AllowBigSelection", False)
  1504. '  XXgrid.AllowUserResizing = PropBag.ReadProperty("AllowUserResizing", 3)
  1505. '  XXgrid.Appearance = PropBag.ReadProperty("Appearance", 1)
  1506. '  XXgrid.CellAlignment = PropBag.ReadProperty("CellAlignment", 0)
  1507. '  XXgrid.CellBackColor = PropBag.ReadProperty("CellBackColor", 0)
  1508. '  XXgrid.CellFontBold = PropBag.ReadProperty("CellFontBold", 0)
  1509. '  XXgrid.CellFontItalic = PropBag.ReadProperty("CellFontItalic", 0)
  1510. '  XXgrid.CellFontName = PropBag.ReadProperty("CellFontName", "")
  1511. '  XXgrid.CellFontSize = PropBag.ReadProperty("CellFontSize", 0)
  1512. '  XXgrid.CellFontStrikeThrough = PropBag.ReadProperty("CellFontStrikeThrough", 0)
  1513. '  XXgrid.CellFontUnderline = PropBag.ReadProperty("CellFontUnderline", 0)
  1514. '  XXgrid.CellFontWidth = PropBag.ReadProperty("CellFontWidth", 0)
  1515. '  XXgrid.CellForeColor = PropBag.ReadProperty("CellForeColor", 0)
  1516. '  Set CellPicture = PropBag.ReadProperty("CellPicture", Nothing)
  1517. '  XXgrid.CellPictureAlignment = PropBag.ReadProperty("CellPictureAlignment", 0)
  1518. '  XXgrid.CellTextStyle = PropBag.ReadProperty("CellTextStyle", 0)
  1519. '  XXgrid.Col = PropBag.ReadProperty("Col", 0)
  1520. ''TO DO: The member you have mapped to contains an array of data.
  1521. ''   You must supply the code to persist the array.  A prototype
  1522. ''   line is shown next:
  1523. '  For Index = 0 To XXgrid.Cols - 1
  1524. '    XXgrid.ColAlignment(Index) = PropBag.ReadProperty("ColAlignment" & Index, 0)
  1525. '  Next
  1526. ''TO DO: The member you have mapped to contains an array of data.
  1527. ''   You must supply the code to persist the array.  A prototype
  1528. ''   line is shown next:
  1529. '  For Index = 0 To XXgrid.Cols - 1
  1530. '    XXgrid.ColData(Index) = PropBag.ReadProperty("ColData" & Index, 0)
  1531. '  Next
  1532. ''TO DO: The member you have mapped to contains an array of data.
  1533. ''   You must supply the code to persist the array.  A prototype
  1534. ''   line is shown next:
  1535. '' COLPOSITION is SET only (no GET)
  1536. ''  For Index = 0 To XXgrid.Cols - 1
  1537. ''    XXgrid.ColPosition(Index) = PropBag.ReadProperty("ColPosition" & Index, 0)
  1538. ''  Next
  1539. '  XXgrid.Cols = PropBag.ReadProperty("Cols", 2)
  1540. '  XXgrid.ColSel = PropBag.ReadProperty("ColSel", 0)
  1541. ''TO DO: The member you have mapped to contains an array of data.
  1542. ''   You must supply the code to persist the array.  A prototype
  1543. ''   line is shown next:
  1544. '  For Index = 0 To XXgrid.Cols - 1
  1545. '    XXgrid.ColWidth(Index) = PropBag.ReadProperty("ColWidth" & Index, 1)
  1546. '  Next
  1547. '  XXgrid.Enabled = PropBag.ReadProperty("Enabled", True)
  1548. '  XXgrid.FillStyle = PropBag.ReadProperty("FillStyle", 0)
  1549. ''TO DO: The member you have mapped to contains an array of data.
  1550. ''   You must supply the code to persist the array.  A prototype
  1551. ''   line is shown next:
  1552. '  For Index = 0 To XXgrid.Cols - 1
  1553. '    XXgrid.FixedAlignment(Index) = PropBag.ReadProperty("FixedAlignment" & Index, 0)
  1554. '  Next
  1555. '  XXgrid.FixedCols = PropBag.ReadProperty("FixedCols", 1)
  1556. '  XXgrid.FixedRows = PropBag.ReadProperty("FixedRows", 1)
  1557. '  XXgrid.FocusRect = PropBag.ReadProperty("FocusRect", 2)
  1558. '  Set UserControl.Font = PropBag.ReadProperty("Font", Ambient.Font)
  1559. '  Call SyncFonts
  1560. '  XXgrid.FontWidth = PropBag.ReadProperty("FontWidth", 0)
  1561. '  XXgrid.ForeColor = PropBag.ReadProperty("ForeColor", &H80000008)
  1562. '  XXgrid.ForeColorFixed = PropBag.ReadProperty("ForeColorFixed", 2147483666#)
  1563. '  XXgrid.ForeColorSel = PropBag.ReadProperty("ForeColorSel", 2147483662#)
  1564. '  XXgrid.FormatString = PropBag.ReadProperty("FormatString", "")
  1565. '  XXgrid.GridColor = PropBag.ReadProperty("GridColor", 12632256)
  1566. '  XXgrid.GridColorFixed = PropBag.ReadProperty("GridColorFixed", 0)
  1567. '  XXgrid.GridLines = PropBag.ReadProperty("GridLines", 1)
  1568. '  XXgrid.GridLinesFixed = PropBag.ReadProperty("GridLinesFixed", 2)
  1569. '  XXgrid.GridLineWidth = PropBag.ReadProperty("GridLineWidth", 1)
  1570. '  XXgrid.HighLight = PropBag.ReadProperty("HighLight", 1)
  1571. '  XXgrid.LeftCol = PropBag.ReadProperty("LeftCol", XXgrid.FixedCols)
  1572. '  XXgrid.MergeCells = PropBag.ReadProperty("MergeCells", 0)
  1573. ''TO DO: The member you have mapped to contains an array of data.
  1574. ''   You must supply the code to persist the array.  A prototype
  1575. ''   line is shown next:
  1576. '  For Index = 0 To XXgrid.Cols - 1
  1577. '    XXgrid.MergeCol(Index) = PropBag.ReadProperty("MergeCol" & Index, 0)
  1578. '  Next
  1579. ''TO DO: The member you have mapped to contains an array of data.
  1580. ''   You must supply the code to persist the array.  A prototype
  1581. ''   line is shown next:
  1582. '  For Index = 0 To XXgrid.Rows - 1
  1583. '    XXgrid.MergeRow(Index) = PropBag.ReadProperty("MergeRow" & Index, 0)
  1584. '  Next
  1585. '  Set MouseIcon = PropBag.ReadProperty("MouseIcon", Nothing)
  1586. '  XXgrid.MousePointer = PropBag.ReadProperty("MousePointer", 0)
  1587. '  XXgrid.Redraw = PropBag.ReadProperty("Redraw", True)
  1588. '  XXgrid.Row = PropBag.ReadProperty("Row", 0)
  1589. ''TO DO: The member you have mapped to contains an array of data.
  1590. ''   You must supply the code to persist the array.  A prototype
  1591. ''   line is shown next:
  1592. '  For Index = 0 To XXgrid.Rows - 1
  1593. '    XXgrid.RowData(Index) = PropBag.ReadProperty("RowData" & Index, 0)
  1594. '  Next
  1595. ''TO DO: The member you have mapped to contains an array of data.
  1596. ''   You must supply the code to persist the array.  A prototype
  1597. ''   line is shown next:
  1598. '  For Index = 0 To XXgrid.Rows - 1
  1599. '    XXgrid.RowHeight(Index) = PropBag.ReadProperty("RowHeight" & Index, 1)
  1600. '  Next
  1601. '  XXgrid.RowHeightMin = PropBag.ReadProperty("RowHeightMin", 1)
  1602. ''TO DO: The member you have mapped to contains an array of data.
  1603. ''   You must supply the code to persist the array.  A prototype
  1604. ''   line is shown next:
  1605. '' ROWPOSITION is SET only (no GET)
  1606. ''  For Index = 0 To XXgrid.Rows - 1
  1607. ''    XXgrid.RowPosition(Index) = PropBag.ReadProperty("RowPosition" & Index, 0)
  1608. ''  Next
  1609. '  XXgrid.Rows = PropBag.ReadProperty("Rows", 2)
  1610. '  XXgrid.RowSel = PropBag.ReadProperty("RowSel", 0)
  1611. '  XXgrid.ScrollBars = PropBag.ReadProperty("ScrollBars", 3)
  1612. '  XXgrid.ScrollTrack = PropBag.ReadProperty("ScrollTrack", True)
  1613. '  XXgrid.Text = PropBag.ReadProperty("Text", "")
  1614. ''TO DO: The member you have mapped to contains an array of data.
  1615. ''   You must supply the code to persist the array.  A prototype
  1616. ''   line is shown next:
  1617. '  For Index = 0 To (XXgrid.Rows * XXgrid.Cols) - 1
  1618. '    XXgrid.TextArray(Index) = PropBag.ReadProperty("TextArray" & Index, "")
  1619. '  Next
  1620. '' Sort is SET only (no GET)
  1621. ''  XXgrid.Sort = PropBag.ReadProperty("Sort", 0)
  1622. ''TO DO: The member you have mapped to contains an array of data.
  1623. ''   You must supply the code to persist the array.  A prototype
  1624. ''   line is shown next:
  1625. '  For iRow = 0 To XXgrid.Rows - 1
  1626. '    For iCol = 0 To XXgrid.Cols - 1
  1627. '      XXgrid.TextMatrix(iRow, iCol) = PropBag.ReadProperty("TextMatrix" & "R" & iRow & "C" & iCol, "")
  1628. '    Next
  1629. '  Next
  1630. '  XXgrid.TextStyle = PropBag.ReadProperty("TextStyle", 0)
  1631. '  XXgrid.TextStyleFixed = PropBag.ReadProperty("TextStyleFixed", 0)
  1632. '  XXgrid.ToolTipText = PropBag.ReadProperty("ToolTipText", "")
  1633. '  XXgrid.TopRow = PropBag.ReadProperty("TopRow", XXgrid.FixedRows)
  1634. '  XXgrid.WordWrap = PropBag.ReadProperty("WordWrap", False)
  1635. '  UserControl.Width = PropBag.ReadProperty("Width", 3000)
  1636. '  UserControl.Height = PropBag.ReadProperty("Height", 3000)
  1637. End Sub
  1638. 'Write property values to storage
  1639. Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
  1640. Dim Index As Integer
  1641. Dim irow, icol
  1642. '  Call PropBag.WriteProperty("AllowBigSelection", XXgrid.AllowBigSelection, False)
  1643. '  Call PropBag.WriteProperty("AllowUserResizing", XXgrid.AllowUserResizing, 3)
  1644. '  Call PropBag.WriteProperty("Appearance", XXgrid.Appearance, 1)
  1645. '  Call PropBag.WriteProperty("CellAlignment", XXgrid.CellAlignment, 0)
  1646. '  Call PropBag.WriteProperty("CellBackColor", XXgrid.CellBackColor, 0)
  1647. '  Call PropBag.WriteProperty("CellFontBold", XXgrid.CellFontBold, 0)
  1648. '  Call PropBag.WriteProperty("CellFontItalic", XXgrid.CellFontItalic, 0)
  1649. '  Call PropBag.WriteProperty("CellFontName", XXgrid.CellFontName, "")
  1650. '  Call PropBag.WriteProperty("CellFontSize", XXgrid.CellFontSize, 0)
  1651. '  Call PropBag.WriteProperty("CellFontStrikeThrough", XXgrid.CellFontStrikeThrough, 0)
  1652. '  Call PropBag.WriteProperty("CellFontUnderline", XXgrid.CellFontUnderline, 0)
  1653. '  Call PropBag.WriteProperty("CellFontWidth", XXgrid.CellFontWidth, 0)
  1654. '  Call PropBag.WriteProperty("CellForeColor", XXgrid.CellForeColor, 0)
  1655. '  Call PropBag.WriteProperty("CellPicture", CellPicture, Nothing)
  1656. '  Call PropBag.WriteProperty("CellPictureAlignment", XXgrid.CellPictureAlignment, 0)
  1657. '  Call PropBag.WriteProperty("CellTextStyle", XXgrid.CellTextStyle, 0)
  1658. '  Call PropBag.WriteProperty("Col", XXgrid.Col, 0)
  1659. ''TO DO: The member you have mapped to contains an array of data.
  1660. ''   You must supply the code to persist the array.  A prototype
  1661. ''   line is shown next:
  1662. '  For Index = 0 To XXgrid.Cols - 1
  1663. '    Call PropBag.WriteProperty("ColAlignment" & Index, XXgrid.ColAlignment(Index), 0)
  1664. '  Next
  1665. ''TO DO: The member you have mapped to contains an array of data.
  1666. ''   You must supply the code to persist the array.  A prototype
  1667. ''   line is shown next:
  1668. '  For Index = 0 To XXgrid.Cols - 1
  1669. '   Call PropBag.WriteProperty("ColData" & Index, XXgrid.ColData(Index), 0)
  1670. '  Next
  1671. ''TO DO: The member you have mapped to contains an array of data.
  1672. ''   You must supply the code to persist the array.  A prototype
  1673. ''   line is shown next:
  1674. ''  For Index = 0 To XXgrid.Cols - 1
  1675. ''    Call PropBag.WriteProperty("ColPosition" & Index, XXgrid.ColPosition(Index), 0)
  1676. ''  Next
  1677. '  Call PropBag.WriteProperty("Cols", XXgrid.Cols, 2)
  1678. '  Call PropBag.WriteProperty("ColSel", XXgrid.ColSel, 0)
  1679. ''TO DO: The member you have mapped to contains an array of data.
  1680. ''   You must supply the code to persist the array.  A prototype
  1681. ''   line is shown next:
  1682. '  For Index = 0 To XXgrid.Cols - 1
  1683. '    Call PropBag.WriteProperty("ColWidth" & Index, XXgrid.ColWidth(Index), 1)
  1684. '  Next
  1685. '  Call PropBag.WriteProperty("Enabled", XXgrid.Enabled, True)
  1686. '  Call PropBag.WriteProperty("FillStyle", XXgrid.FillStyle, 0)
  1687. ''TO DO: The member you have mapped to contains an array of data.
  1688. ''   You must supply the code to persist the array.  A prototype
  1689. ''   line is shown next:
  1690. '  For Index = 0 To XXgrid.Cols - 1
  1691. '    Call PropBag.WriteProperty("FixedAlignment" & Index, XXgrid.FixedAlignment(Index), 0)
  1692. '  Next
  1693. '  Call PropBag.WriteProperty("FixedCols", XXgrid.FixedCols, 1)
  1694. '  Call PropBag.WriteProperty("FixedRows", XXgrid.FixedRows, 1)
  1695. '  Call PropBag.WriteProperty("FocusRect", XXgrid.FocusRect, 2)
  1696. '  Call PropBag.WriteProperty("Font", UserControl.Font, Ambient.Font)
  1697. '  Call PropBag.WriteProperty("FontWidth", XXgrid.FontWidth, 0)
  1698. '  Call PropBag.WriteProperty("ForeColor", XXgrid.ForeColor, &H80000008)
  1699. '  Call PropBag.WriteProperty("ForeColorFixed", XXgrid.ForeColorFixed, 2147483666#)
  1700. '  Call PropBag.WriteProperty("ForeColorSel", XXgrid.ForeColorSel, 2147483662#)
  1701. '  Call PropBag.WriteProperty("FormatString", XXgrid.FormatString, "")
  1702. '  Call PropBag.WriteProperty("GridColor", XXgrid.GridColor, 12632256)
  1703. '  Call PropBag.WriteProperty("GridColorFixed", XXgrid.GridColorFixed, 0)
  1704. '  Call PropBag.WriteProperty("GridLines", XXgrid.GridLines, 1)
  1705. '  Call PropBag.WriteProperty("GridLinesFixed", XXgrid.GridLinesFixed, 2)
  1706. '  Call PropBag.WriteProperty("GridLineWidth", XXgrid.GridLineWidth, 1)
  1707. '  Call PropBag.WriteProperty("HighLight", XXgrid.HighLight, 1)
  1708. '  Call PropBag.WriteProperty("LeftCol", XXgrid.LeftCol, 0)
  1709. '  Call PropBag.WriteProperty("MergeCells", XXgrid.MergeCells, 0)
  1710. ''TO DO: The member you have mapped to contains an array of data.
  1711. ''   You must supply the code to persist the array.  A prototype
  1712. ''   line is shown next:
  1713. '  For Index = 0 To XXgrid.Cols - 1
  1714. '    Call PropBag.WriteProperty("MergeCol" & Index, XXgrid.MergeCol(Index), 0)
  1715. '  Next
  1716. ''TO DO: The member you have mapped to contains an array of data.
  1717. ''   You must supply the code to persist the array.  A prototype
  1718. ''   line is shown next:
  1719. '  For Index = 0 To XXgrid.Rows - 1
  1720. '    Call PropBag.WriteProperty("MergeRow" & Index, XXgrid.MergeRow(Index), 0)
  1721. '  Next
  1722. '  Call PropBag.WriteProperty("MouseIcon", MouseIcon, Nothing)
  1723. '  Call PropBag.WriteProperty("MousePointer", XXgrid.MousePointer, 0)
  1724. '  Call PropBag.WriteProperty("Redraw", XXgrid.Redraw, True)
  1725. '  Call PropBag.WriteProperty("Row", XXgrid.Row, 0)
  1726. ''TO DO: The member you have mapped to contains an array of data.
  1727. ''   You must supply the code to persist the array.  A prototype
  1728. ''   line is shown next:
  1729. '  For Index = 0 To XXgrid.Rows - 1
  1730. '    Call PropBag.WriteProperty("RowData" & Index, XXgrid.RowData(Index), 0)
  1731. '  Next
  1732. ''TO DO: The member you have mapped to contains an array of data.
  1733. ''   You must supply the code to persist the array.  A prototype
  1734. ''   line is shown next:
  1735. '  For Index = 0 To XXgrid.Rows - 1
  1736. '    Call PropBag.WriteProperty("RowHeight" & Index, XXgrid.RowHeight(Index), 1)
  1737. '  Next
  1738. '  Call PropBag.WriteProperty("RowHeightMin", XXgrid.RowHeightMin, 1)
  1739. ''TO DO: The member you have mapped to contains an array of data.
  1740. ''   You must supply the code to persist the array.  A prototype
  1741. ''   line is shown next:
  1742. ''  For Index = 0 To XXgrid.Rows - 1
  1743. ''    Call PropBag.WriteProperty("RowPosition" & Index, XXgrid.RowPosition(Index), 0)
  1744. ''  Next
  1745. '  Call PropBag.WriteProperty("Rows", XXgrid.Rows, 2)
  1746. '  Call PropBag.WriteProperty("RowSel", XXgrid.RowSel, 0)
  1747. '  Call PropBag.WriteProperty("ScrollBars", XXgrid.ScrollBars, 3)
  1748. '  Call PropBag.WriteProperty("ScrollTrack", XXgrid.ScrollTrack, True)
  1749. '  Call PropBag.WriteProperty("Text", XXgrid.Text, "")
  1750. ''TO DO: The member you have mapped to contains an array of data.
  1751. ''   You must supply the code to persist the array.  A prototype
  1752. ''   line is shown next:
  1753. '  For Index = 0 To (XXgrid.Rows * XXgrid.Cols) - 1
  1754. '    Call PropBag.WriteProperty("TextArray" & Index, XXgrid.TextArray(Index), "")
  1755. '  Next
  1756. ''  Call PropBag.WriteProperty("Sort", XXgrid.Sort, 0)
  1757. ''TO DO: The member you have mapped to contains an array of data.
  1758. ''   You must supply the code to persist the array.  A prototype
  1759. ''   line is shown next:
  1760. '  For iRow = 0 To XXgrid.Rows - 1
  1761. '    For iCol = 0 To XXgrid.Cols - 1
  1762. '      Call PropBag.WriteProperty("TextMatrix" & "R" & iRow & "C" & iCol, XXgrid.TextMatrix(iRow, iCol), "")
  1763. '    Next
  1764. '  Next
  1765. '  Call PropBag.WriteProperty("TextStyle", XXgrid.TextStyle, 0)
  1766. '  Call PropBag.WriteProperty("TextStyleFixed", XXgrid.TextStyleFixed, 0)
  1767. '  Call PropBag.WriteProperty("ToolTipText", XXgrid.ToolTipText, "")
  1768. '  Call PropBag.WriteProperty("TopRow", XXgrid.TopRow, 0)
  1769. '  Call PropBag.WriteProperty("WordWrap", XXgrid.WordWrap, False)
  1770. '  Call PropBag.WriteProperty("Width", UserControl.Width, 2000)
  1771. '  UserControl.Width = PropBag.ReadProperty("Width", 3000)
  1772. '  UserControl.Height = PropBag.ReadProperty("Height", 3000)
  1773. End Sub
  1774.