Public Sub hjdx(ByVal msfGrid As MSFlexGrid)
With msfGrid
.MergeCells = flexMergeRestrictRows
.MergeRow(6) = True
'下两格相同值,但不合并。
.TextMatrix(6, 3) = jf
.TextMatrix(6, 4) = jf + " "
'下两格相同值,合并。
.TextMatrix(6, 1) = "大写金额:" & ChMoney(.TextMatrix(6, 3))
.TextMatrix(6, 2) = "大写金额:" & ChMoney(.TextMatrix(6, 3))
End With
End Sub
With msfGrid
.MergeCells = flexMergeRestrictRows
.MergeRow(6) = True
'下两格相同值,但不合并。
.TextMatrix(6, 3) = jf
.TextMatrix(6, 4) = jf + " "
'下两格相同值,合并。
.TextMatrix(6, 1) = "大写金额:" & ChMoney(.TextMatrix(6, 3))
.TextMatrix(6, 2) = "大写金额:" & ChMoney(.TextMatrix(6, 3))
End With
End Sub
解决方案 »
- Form_Load下调用函数无效
- 请问各位高手如何屏蔽到系统里面的Caps lock键
- VB里有没有类似C++ Builder里面的快速按钮组件?
- 我做的一个纯DHTM的游戏,htm格式的,大家来看原代码!!
- VB里运用极坐标求点的位置
- TabStrip 控件怎么让它点了之后出现不同的内容呀?谢谢
- 如何得知指定的一个窗体当前己经打开了??
- MSHFlexGrid控件??
- 高分求助关于打包
- 怎样在picture中缩小图片,如象image中国的strecth那样
- 完整的《学生档案管理系统》源码出售,有要的请和我联系。
- 等了3天啦,还没有解决问题,CSDN上就没有人会这个问题吗?about ture type font
On The Form1,Insert One MSFlexGrid Named MSFlexGrid1:
Private Sub Form_Load() With MSFlexGrid1
.Rows = 10
.Cols = 5
.Row = 0
.MergeCells = flexMergeRestrictColumns
.MergeRow(0) = True
.MergeCol(1) = True
.MergeCol(2) = True
.MergeCol(3) = False
.MergeCol(4) = False
'下两格相同值,合并。
.TextMatrix(0, 1) = "NorthWest"
.TextMatrix(0, 2) = "NorthWest"
'下两格相同值,但不合并。
.TextMatrix(0, 3) = "East"
.TextMatrix(0, 4) = "East"
End With
End Sub
More Information:Returns or sets a value that determines whether cells with the same contents should be grouped in a single cell spanning multiple rows or columns.Syntax
object.MergeCells [=value]The MergeCells property syntax has these parts:Part Description
object An object expression that evaluates to an object in the Applies To list.
value An integer or constant that specifies the grouping (merging) of cells, as specified in Settings.
SettingsThe settings for value are:Constant Value Description
flexMergeNever 0 Never. The cells containing identical content are not grouped. This is the default.
flexMergeFree 1 Free. Cells with identical content always merge.
flexMergeRestrictRows 2 Restrict Rows. Only adjacent cells (to the left of the current cell) within the row containing identical content merge.
flexMergeRestrictColumns 3 Restrict Columns. Only adjacent cells (to the top of the current cell) within the column containing identical content merge.
flexMergeRestrictBoth 4 Restrict Both. Only adjacent cells within the row (to the left) or column (to the top) containing identical content merge.
ResThe ability to merge cells makes it possible for you to present data in a clear, concise manner. You can use cell merging in conjunction with the sorting and column order functions of the ModHFGrid.To use the cell merging capabilities of the ModHFGrid: Set MergeCells to a value other than zero. (The difference between the settings is explained in the example.)
Set the MergeRow and MergeCol array properties to True for the rows and columns to be merged.
When using the cell merging capabilities, the ModHFGrid merges cells with identical content. The merging is automatically updated whenever the cell content changes.When MergeCells is set to a value other than 0 (Never), selection highlighting is automatically turned off. This is done to speed up repainting and because selection of ranges containing merged cells may lead to unexpected results.
| 本月进仓 |
|---------------|
|数量|单价| 金额|
----------------- With MSFlexGrid1
.Cols = 5
.Rows = 10
.FixedRows = 2
.FixedCols = 0
.TextMatrix(0, 0) = "本月进仓"
.TextMatrix(0, 1) = "本月进仓"
.TextMatrix(0, 2) = "本月进仓"
.TextMatrix(1, 0) = "数量"
.TextMatrix(1, 1) = "单价"
.TextMatrix(1, 2) = "金额"
.MergeCells = flexMergeRestrictRows
' 下面是合并不同的形式
'.MergeCells = flexMergeFree
'.MergeCells = flexMergeNever
'.MergeCells = flexMergeRestrictAll
'.MergeCells = flexMergeRestrictColumns
'.MergeCells = flexMergeRestrictRows
'执行合并
.MergeRow(0) = True
End With