VSFlexGrid Properties, Events, and Methods

All of the properties, events, and methods for the VSFlexGrid control are listed in the following tables. Properties, events, and methods that apply only to this control, or that require special consideration when used with it, are marked with an asterisk (*). These are documented in later sections. For documentation on the remaining properties, see the Visual Basic documentation.

Properties

*AccessibleDescription

Gets or sets the description of the control used by accessibility client applications.

*AccessibleName

Gets or sets the name of the control used by accessibility client applications.

*AccessibleRole

Gets or sets the role of the control used by accessibility client applications.

*AccessibleValue

Gets or sets the value of the control used by accessibility client applications.

*Aggregate

Returns an aggregate function (sum, average, and so on) for a given range.

*Align

Returns or sets a value that determines where an object is displayed on a form.

*AllowBigSelection

Returns or sets whether clicking on the fixed area will select entire columns and rows.

*AllowSelection

Returns or sets whether the user can select ranges of cells with the mouse and keyboard.

*AllowUserFreezing

Returns or sets whether the user is allowed to freeze rows and columns with the mouse.

*AllowUserResizing

Returns or sets whether the user is allowed to resize rows and columns with the mouse.

*Appearance

Returns or sets the paint style of the control on an MDIForm or Form object.

*ArchiveInfo

Returns information from a VSFlex archive file.

*AutoResize

Returns or sets whether column widths will be automatically adjusted when data is loaded.

*AutoSearch

Returns or sets whether the control will search for entries as they are typed.

*AutoSearchDelay

Returns or sets the delay, in seconds, before the AutoSearch buffer is reset.

*AutoSizeMode

Returns or sets whether AutoSize will adjust column widths or row heights to fit cell contents.

*AutoSizeMouse

Returns or sets whether columns should be resized to fit when the user double-clicks on the header row.

*BackColor

Returns or sets the background color of the non-fixed cells.

*BackColorAlternate

Returns or sets the background color for alternate rows (set to 0 to disable).

*BackColorBkg

Returns or sets the background color of the area not covered by any cells.

*BackColorFixed

Returns or sets the background color of the fixed rows and columns.

*BackColorFrozen

Returns or sets the background color of the frozen rows and columns.

*BackColorSel

Returns or sets the background color of the selected cells.

*Bookmark

Returns the Bookmark associated with a given row when the grid is bound to an ADO recordset (read-only).

*BorderStyle

Returns or sets the border style for the control.

*BottomRow

Returns the zero-based index of the last row displayed in the control.

*CausesValidation

Returns or sets whether validation occurs on the control which lost focus.

*Cell

Returns or sets cell properties for an arbitrary range.

*CellAlignment

Returns or sets the alignment of text in the selected cell or range.

*CellBackColor

Returns or sets the background color of the selected cell or range.

*CellButtonPicture

Returns or sets the picture used in cell buttons.

*CellChecked

Returns or sets whether a grid cell has a check mark in it.

*CellFloodColor

Returns or sets the color to be used for flooding a cell.

*CellFloodPercent

Returns or sets the percentage of flooding for a cell.

*CellFontBold

Returns or sets the Bold attribute of the font of the selected cell or range.

*CellFontItalic

Returns or sets the Italic attribute of the font of the selected cell or range.

*CellFontName

Returns or sets the name of the font of the selected cell or range.

*CellFontSize

Returns or sets the size of the font of the selected cell or range.

*CellFontStrikethru

Returns or sets the Strikethru attribute of the font of the selected cell or range.

*CellFontUnderline

Returns or sets the Underline attribute of the font of the selected cell or range.

*CellFontWidth

Returns or sets the width of the font of the selected cell or range.

*CellForeColor

Returns or sets the foreground color of the selected cell or range.

*CellHeight

Returns the height of the selected cell, in twips. Also brings the cell into view, scrolling if necessary.

*CellLeft

Returns the left (x) coordinate of the selected cell relative to the control, in twips. Also brings the cell into view, scrolling if necessary.

*CellPicture

Returns or sets the picture displayed in a selected cell or range.

*CellPictureAlignment

Returns or sets the alignment of the pictures in the selected cell or range.

*CellTextStyle

Returns or sets 3D effects for text in a selected cell or range.

*CellTop

Returns the top (y) coordinate of the selected cell relative to the control, in twips. Also brings the cell into view, scrolling if necessary.

*CellWidth

Returns the width of the selected cell, in twips. Also brings the cell into view, scrolling if necessary.

*ClientHeight

Returns the height of the control's client area, in twips.

*ClientWidth

Returns the width of the control's client area, in twips.

*Clip

Returns or sets the contents of a range.

*ClipSeparators

Returns or sets the characters to be used as column and row separators in Clip strings.

*Col

Returns or sets the zero-based index of the current column.

*ColAlignment

Returns or sets the alignment of the given column.

*ColComboList

Returns or sets the list to be used as a drop-down on the specified column.

*ColData

Returns or sets a user-defined variant associated with the given column.

*ColDataType

Returns or sets the data type for the column.

*ColEditMask

Returns or sets the input mask used to edit cells on the specified column.

*ColFormat

Returns or sets the format used to display numeric values.

*ColHidden

Returns or sets whether a column is hidden.

*ColImageList

Sets or returns a handle to an ImageList to be used as a source of pictures for a given column.

*ColIndent

Returns or sets the indentation of the given column, in twips.

*ColIndex

Returns the column index that matches the given key.

*ColIsVisible

Returns whether a given column is currently within view.

*ColKey

Returns or sets a key used to identify the given column.

*ColPos

Returns the left (x) coordinate of a column relative to the edge of the control, in twips.

*ColPosition

Moves a given column to a new position.

*Cols

Returns or sets the total number of columns in the control.

*ColSel

Returns or sets the extent of a range of columns.

*ColSort

Returns or sets the sorting order for each column (for use with the Sort property).

*ColWidth

Returns or sets the width of the specified column in twips.

*ColWidthMax

Returns or sets the maximum column width, in twips.

*ColWidthMin

Returns or sets the minimum column width, in twips.

*ComboCount

Returns the number of items in the editor's combo list.

*ComboData

Returns the long value associated with an item in the editor's combo list.

*ComboIndex

Returns or sets the zero-based index of the current selection in the editor's combo list.

*ComboItem

Returns the string associated with an item in the editor's combo list.

*ComboList

Returns or sets the list to be used as a drop-down when editing a cell.

*ComboSearch

Returns or sets whether combo lists should support smart searches.

*DataBindings

Returns or sets a DataBindings collection object that collects the bindable properties that are available to the developer (read-only).

*DataMember

Returns or sets the data member.

*DataMode

Returns or sets the type of data binding used by the control when it is connected to a data source (read-only or read/write).

*DataSource

Returns or sets the data source.

*DragMode

Returns or sets a value that determines whether manual or automatic drag mode is used.

*Editable

Returns or sets whether the control allows in-cell editing.

*EditMask

Returns or sets the input mask used to edit cells.

*EditMaxLength

Returns or sets the maximum number of characters that can be entered in the editor.

*EditSelLength

Returns or the number of characters selected in the editor.

*EditSelStart

Returns or sets the starting point of text selected in the editor.

*EditSelText

Returns or sets the string containing the current selection in the editor.

*EditText

Returns or sets the text in the cell editor.

*EditWindow

Returns a handle to the grid's editing window, or 0 if the grid is not in edit mode.

*Ellipsis

Returns or sets whether the control will display ellipsis (...) after long strings.

Enabled

Returns or sets a value that determines whether a form or control can respond to user-generated events. See the Visual Basic documentation for more information.

*ExplorerBar

Returns or sets whether column headers are used to sort and/or move columns.

*ExtendLastCol

Returns or sets whether the last column should be adjusted to fit the control's width.

*FillStyle

Returns or sets whether changes to the Text or Format properties apply to the current cell or to the entire selection.

*FindRow

Returns the index of a row that contains a specified string or RowData value.

*FindRowRegex

Returns the index of the row that contains a match or -1 if no match was found.

*FixedAlignment

Returns or sets the alignment for the fixed rows in a column.

*FixedCols

Returns or sets the number of fixed (non-scrollable) columns.

*FixedRows

Returns or sets the number of fixed (non-scrollable) rows.

*Flags

Gets or sets flags that affect the behavior of the control.

*FlexDataSource

Returns or sets a custom data source for the control.

*FloodColor

Returns or sets the color used to flood cells.

*FocusRect

Returns or sets the type of focus rectangle to be displayed around the current cell.

Font

Returns a Font object. See the Visual Basic documentation for more information.

*FontBold

Determines whether the font is bold.

*FontItalic

Determines whether the font is italicized.

*FontName

Returns or sets the name of the font.

*FontSize

Determines the size of the font.

*FontStrikethru

Determines the strikethru of the font.

*FontUnderline

Determines the font is underlined.

*FontWidth

Returns or sets the width of the font, in points.

*ForeColor

Returns or sets the foreground color of the non-fixed cells.

*ForeColorFixed

Returns or sets the foreground color of the fixed rows and columns.

*ForeColorFrozen

Returns or sets the foreground color of the frozen rows and columns.

*ForeColorSel

Returns or sets the foreground color of the selected cells.

*FormatString

Assigns column widths, alignments, and fixed row and column text.

*FrozenCols

Returns or sets the number of frozen (editable but non-scrollable) columns.

*FrozenRows

Returns or sets the number of frozen (editable but non-scrollable) rows.

*GridColor

Returns or sets the color used to draw the grid lines between the non-fixed cells.

*GridColorFixed

Returns or sets the color used to draw the grid lines between the fixed cells.

*GridLines

Returns or sets the type of lines to be drawn between non-fixed cells.

*GridLinesFixed

Returns or sets the type of lines to be drawn between fixed cells.

*GridLineWidth

Returns or sets the width of the grid lines, in pixels.

*GroupCompare

Returns or sets the type of comparison used when grouping cells.

*HelpContextID

Specifies the default Help file context ID for an object.

*HighLight

Returns or sets whether selected cells will be highlighted.

hWnd

Returns a handle to a form or control. See the Visual Basic documentation for more information.

*IsCollapsed

Returns or sets whether an outline row is collapsed or expanded.

*IsSearching

Returns a value that indicates whether the grid is in search mode.

*IsSelected

Returns or sets whether a row is selected (for listbox-type selections).

*IsSubtotal

Returns or sets whether a row contains subtotals (as opposed to data).

*LeftCol

Returns or sets the zero-based index of the leftmost non-fixed column displayed in the control.

*MergeCells

Returns or sets whether cells with the same contents will be merged into a single cell.

*MergeCellsFixed

Allows users to set different merging criteria for fixed vs. scrollable cells.

*MergeCol

Returns or sets whether a column will have its cells merged.

*MergeCompare

Returns or sets the type of comparison used when merging cells.

*MergeRow

Returns or sets whether a row will have its cells merged.

*MouseCol

Returns the zero-based index of the column under the mouse pointer.

MouseIcon

Returns or sets a custom mouse icon. See the Visual Basic documentation for more information.

MousePointer

Returns or sets a value indicating the type of mouse pointer displayed when the mouse is over a particular part of an object at run time. See the Visual Basic documentation for more information.

*MouseRow

Returns the zero-based index of the row under the mouse pointer.

*MultiTotals

Returns or sets whether subtotals will be displayed in a single row when possible.

*NodeClosedPicture

Returns or sets the picture to be used for closed outline nodes.

*NodeOpenPicture

Returns or sets the picture to be used for open outline nodes.

*OLEDragMode

Returns or sets whether the control can act as an OLE drag source, either automatically or under program control.

*OLEDropMode

Returns or sets whether the control can act as an OLE drop target, either automatically or under program control.

*OutlineBar

Returns or sets the type of outline bar that should be displayed.

*OutlineCol

Returns or sets the column used to display the outline tree.

*OwnerDraw

Returns or sets whether and when the control will fire the DrawCell event.

*Picture

Returns a picture of the entire control.

*PicturesOver

Returns or sets whether text and pictures should be overlaid in cells.

*PictureType

Returns or sets the type of picture returned by the Picture property.

*Redraw

Enables or disables redrawing of the VSFlexGrid control.

*RightCol

Returns the zero-based index of the last column displayed in the control.

*RightToLeft

Returns or sets whether text should be displayed from right to left on Hebrew and Arabic systems.

*Row

Returns or sets the zero-based index of the current row.

*RowData

Returns or sets a user-defined variant associated with the given row.

*RowHeight

Returns or sets the height of the specified row in twips.

*RowHeightMax

Returns or sets the maximum row height, in twips.

*RowHeightMin

Returns or sets the minimum row height, in twips.

*RowHidden

Returns or sets whether a row is hidden.

*RowIsVisible

Returns whether a given row is currently within view.

*RowOutlineLevel

Returns or sets the outline level for a subtotal row.

*RowPos

Returns the top (y) coordinate of a row relative to the edge of the control, in twips.

*RowPosition

Moves a given row to a new position.

*Rows

Returns or sets the total number of rows in the control.

*RowSel

Returns or sets the extent of a range of rows.

*RowStatus

Returns or sets a value that indicates whether a row has been added, deleted, or modified.

*ScrollBars

Returns or sets whether the control will display horizontal or vertical scroll bars.

*ScrollTips

Returns or sets whether ToolTips are shown while the user scrolls vertically.

*ScrollTipText

Returns or sets the ToolTip text shown while the user scrolls vertically.

*ScrollTrack

Returns or sets scrolling should occur while the user moves the scroll thumb.

*SelectedRow

Returns the position of a selected row when SelectionMode is set to flexSelectionListBox.

*SelectedRows

Returns the number of selected rows when SelectionMode is set to flexSelectionListBox.

*SelectionMode

Returns or sets whether the control will select cells in a free range, by row, by column, or like a listbox.

*SheetBorder

Returns or sets the color used to draw the border around the sheet.

*ShowComboButton

Returns or sets whether drop-down buttons are shown when editable cells are selected.

*Sort

Sets a sorting order for the selected rows using the selected columns as keys.

*SortAscendingPicture

Gets or sets a custom image to indicate the column sort direction.

*SortDescendingPicture

Gets or sets a custom image to indicate the column sort direction.

*SubtotalPosition

Returns or sets whether subtotals should be inserted above or below the totaled data.

*TabBehavior

Returns or sets whether the TAB key will move focus between controls (VB default) or between grid cells.

*TabIndex

Returns or sets the tab order of an object within its parent form.

*TabStop

Returns or sets a value indicating whether a user can use the TAB key to give focus to an object.

*Tag

Stores any extra data needed for your program.

*Text

Returns or sets the contents of the selected cell or range.

*TextArray

Returns or sets the contents of a cell identified by a single index.

*TextMatrix

Returns or sets the contents of a cell identified by its row and column coordinates.

*TextStyle

Returns or sets 3D effects for displaying text in non-fixed cells.

*TextStyleFixed

Returns or sets 3D effects for displaying text in fixed cells.

*ToolTipText

Returns or sets the text displayed when the mouse is paused over the control.

*TopRow

Returns or sets the zero-based index of the topmost non-fixed row displayed in the control.

*TreeColor

Returns or sets the color used to draw the outline tree.

*Value

Returns the numeric value of the current cell.

*ValueMatrix

Returns the numeric value of a cell identified by its row and column coordinates.

*Version

Returns the version of the control currently loaded in memory.

*VirtualData

Returns or sets whether all data is fetched from the data source at once or as needed.

*WallPaper

Returns or sets a picture to be used as a background for the control's scrollable area.

*WallPaperAlignment

Returns or sets the alignment of the WallPaper background picture.

*WordWrap

Returns or sets whether text wider that its cell will wrap.

 

Methods

*AddItem

Adds a row to the control.

*Archive

Adds, extracts, or deletes files from a vsFlexGrid archive file.

*AutoSize

Resizes column widths or row heights to fit cell contents.

*BindToArray

Binds the grid to an array of variants to be used as storage.

*BuildComboList

Returns a ColComboList string from data in a recordset.

*CellBorder

Draws a border around and within the selected cells.

*CellBorderRange

Similar to the CellBorder method, but allows the user to specify the range instead of using the selection CellBorderRange.

*Clear

Clears the contents of the control. Optional parameters specify what to clear and where.

*Copy

Copy selection to the Clipboard.

*Cut

Cut selection to the Clipboard.

*DataRefresh

Forces the control to re-fetch all data from its data source.

*Delete

Deletes the selection.

*Drag

Begins, ends, or cancels a drag operation of any object, except Line, Menu, Shape, and Timer.

*DragRow

Starts dragging a row to a new position.

*EditCell

Activates edit mode.

*FinishEditing

Finishes any pending edits and returns the grid to browse mode.

*GetMergedRange

Returns the range of merged cells that includes a given cell.

*GetNode

Returns an outline node object for a given subtotal row.

*GetNodeRow

Returns the number of a row's parent, first, or last child in an outline.

*GetSelection

Returns the current selection ordered so that Row1 <= Row2 and Col1 <= Col2.

*LoadArray

Loads the control with data from a Variant array or from another FlexGrid control.

*LoadGrid

Loads grid contents and format from a file.

*LoadGridURL

Loads grid contents and format from a URL (created with SaveGrid).

*OLEDrag

Initiates an OLE drag operation.

*Outline

Sets an outline level for displaying subtotals.

*Paste

Pastes the selection from the Clipboard.

*PrintGrid

Prints the grid on the printer.

Refresh

Forces a complete repaint of a form or control. See the Visual Basic documentation for more information.

*RemoveItem

Removes a row from the control.

*SaveGrid

Saves grid contents and format to a file.

*Select

Selects a range of cells.

*Subtotal

Inserts rows with summary data.

 

Events

*AfterCollapse

Fired after the user expands or collapses one or more rows in an outline.

*AfterDataRefresh

Fired after reading data from the record source.

*AfterEdit

Fired after the control exits cell edit mode.

*AfterMoveColumn

Fired after a column is moved by dragging on the ExplorerBar.

*AfterMoveRow

Fired after a row is moved by dragging on the ExplorerBar or using the DragRow method.

*AfterRowColChange

Fired after the current cell (Row, Col) changes to a different cell.

*AfterScroll

Fired after the control scrolls.

*AfterSelChange

Fired after the selected range (RowSel, ColSel) changes.

*AfterSort

Fired after a column is sorted by a click on the ExplorerBar.

*AfterUserFreeze

Fired after the user changes the number of frozen rows or columns.

*AfterUserResize

Fired after the user resizes a row or a column.

*BeforeCollapse

Fired before the user expands or collapses one or more rows in an outline.

*BeforeDataRefresh

Fired before reading data from the record source.

*BeforeEdit

Fired before the control enters cell edit mode.

*BeforeMouseDown

Fired before the control processes the MouseDown event.

*BeforeMoveColumn

Fired before a column is moved by dragging on the ExplorerBar.

*BeforeMoveRow

Fired before a row is moved by dragging on the ExplorerBar or using the DragRow method.

*BeforePageBreak

Fired while printing the control to control page breaks.

*BeforeRowColChange

Fired before the current cell (Row, Col) changes to a different cell.

*BeforeScroll

Fired before the control scrolls.

*BeforeScrollTip

Fired before a scroll tip is shown so you can set the ScrollTipText property.

*BeforeSelChange

Fired before the selected range (RowSel, ColSel) changes.

*BeforeSort

Fired before a column is sorted by a click on the ExplorerBar.

*BeforeUserResize

Fired before the user starts resizing a row or column, allows cancel.

*CellButtonClick

Fired after the user clicks a cell button.

*CellChanged

Fired after a cell's contents change.

*ChangeEdit

Fired after the text in the editor has changed.

Click

This event occurs when a user presses and then releases the button of mouse device over an object. See the Visual Basic documentation for more information.

*ComboCloseUp

Fired before the built-in combobox closes up.

*ComboDropDown

Fired before the built-in combobox drops down.

*Compare

Fired when the Sort property is set to flexSortCustom, to allow custom comparison of rows.

DblClick

This event occurs when the user double-clicks an object.

*DrawCell

Fired when the OwnerDraw property is set to allow custom cell drawing.

*EndAutoSearch

Fired when the grid leaves AutoSearch mode.

*EnterCell

Fired when a cell becomes active.

*Error

Fired after a data-access error.

*FilterData

Fired after a value is read and before a value is written to a recordset to allow custom formatting.

*GetHeaderRow

Fired while printing the control to set repeating header rows.

KeyDown

This event occurs when a user presses a key while an object has the focus.

*KeyDownEdit

Fired when the user presses a key in cell-editing mode.

KeyPress

This event occurs when the user presses and releases an ANSI key.

*KeyPressEdit

Fired when the user presses a key in cell-editing mode.

KeyUp

Occurs when the user releases a key.

*KeyUpEdit

Fired when the user presses a key in cell-editing mode.

*LeaveCell

Fired before the current cell changes to a different cell.

MouseDown

Occur when the user presses (MouseDown) a mouse button.

MouseMove

Occurs when the user moves the mouse.

MouseUp

Occur when the user releases (MouseUp) a mouse button.

*OLECompleteDrag

Fired after a drop to inform the source component that a drag action was either performed or canceled.

*OLEDragDrop

Fired when a source component is dropped onto a target component.

*OLEDragOver

Fired when a component is dragged over another.

*OLEGiveFeedback

Fired after every OLEDragOver event to allow the source component to provide visual feedback to the user.

*OLESetCustomDataObject

Fired after an OLE drag operation is started (manually or automatically), allows you to provide a custom DataObject.

*OLESetData

Fired on the source component when a target component performs the GetData method on the source’s DataObject object.

*OLEStartDrag

Fired after an OLE drag operation is started (manually or automatically).

*RowColChange

Fired when the current cell (Row, Col) changes to a different cell.

*SelChange

Fired after the selected range (RowSel, ColSel) changes.

*SetupEditStyle

Fired before the EditWindow is created, used to modify window styles.

*SetupEditWindow

Fired after the EditWindow has been created and before it is displayed.

*StartAutoSearch

Fired when the grid enters AutoSearch mode.

*StartEdit

Fired when the control enters cell edit mode (after BeforeEdit).

*StartPage

Fired before each page while the grid is being printed.

*ValidateEdit

Fired before the control exits cell edit mode.

 


VSFlexGrid Properties

VSFlexGrid Methods

VSFlexGrid Events