VsFlexGrid控件的用法?

解决方案 »

  1.   

    VSFlexGrid 常用属性或方法: 
    .FixedRows = 1                            '固定几行
    .FixedCols = 1                            '固定几列
    .Editable = True                          '允许修改
    .AllowUserResizing = flexResizeBoth       '可调整行/列
    .FocusRect = flexFocusNone                '无虚框
    .SelectionMode = flexSelectionListBox     '焦点选中样式
    .BackColor = RGB(255, 255, 255)           '单元背景色
    .BackColorSel = vbBlue                    '单元选择色
    .BackColorFixed = RGB(208, 192, 160)      '固定单元色
    .BackColorAlternate = RGB(255, 250, 230)  '间隔行背景色
    .GridColor = RGB(245, 240, 210)           '单元线条色
    .ForeColor = RGB(0, 0, 0)                 '单元前景色(字符色)
    .RowHeightMin = 260                       '最小行高
    .RowHeightMax = 800                       '最大行高
    .ColHeightMin = 50                        '最小列宽
    .ColHeightMax = 3000                      '最大列宽
    .ColWidth(Col) = 1000                     '指定列宽
    .RowHeight(Row) = 260                     '指定行高
    .TextMatrix(Row,Col) = "Text"             '指定单元字符
    .Text = "Text"                            '选定单元字符
    .MergeCol(Col) = True                     '允许合并列
    .MergeRow(Row) = True                     '允许合并行
    .MergeCells = 0|1|2|3|4|5|6               '合并选项
    .Cell(选项准则, Row1, Col1, Row2, Col2)   '选择部分的相应准则值
    .EditCell                                 '当移动到当前单元时自动选择
    .EditSelStart                             '移动到单元时的光标位置
    .MousePointer                             '设置对象的鼠标指针样式 O.A = 0 到 15|99