请问MSHFlexGrid如何合并单元格? 我想合并相同内容的单元格,如何写? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Private datPrimaryRS As ADODB.Recordset' 打开连接 sSQL = "select dw_bm,dw_mc from dw_table where dw_mc like'%" & Text1.Text & "%' order by dw_bm" sConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\计划管理系统.mdb;Persist Security Info=False" Set dfwConn = New Connection dfwConn.Open sConnect ' 使用提供的集合创建 recordset Set datPrimaryRS = New Recordset datPrimaryRS.CursorLocation = adUseClient datPrimaryRS.Open sSQL, dfwConn, adOpenForwardOnly, adLockReadOnly Set MSHFlexGrid1.DataSource = datPrimaryRS With MSHFlexGrid1 Select Case Combo1.ListIndex Case 0 .FormatString = "单位编码|单位名称" .Redraw = False ' 设置网格列宽度 .ColWidth(0) = 1000 .ColWidth(1) = 3000 End Select ' 设置网格列合并和排序 For i = 0 To .Cols - 1 .MergeCol(i) = True Next i .Sort = flexSortGenericAscending ' 设置网格样式 .AllowBigSelection = True .FillStyle = flexFillRepeat ' 将标头作成粗体 .Row = 0 .Col = 0 .RowSel = .FixedRows - 1 .ColSel = .Cols - 1 .CellFontBold = True ' 隔列变灰 For i = .FixedCols To .Cols() - 1 Step 2 .Col = i .Row = .FixedRows .RowSel = .Rows - 1 .CellBackColor = &HC0C0C0 ' 浅灰 Next i .AllowBigSelection = False .FillStyle = flexFillSingle .Redraw = True End With datPrimaryRS.Close Set datPrimaryRS = Nothing ole/activex控件和动态库类的文件一定要注册才能使用吗 监控注册表值并修改 在主窗体中弹出一个查询窗体,然后返回主窗体一个字符串,如何实现呢?(即两个窗体间如何传递信息) vba autocad 圆弧中点座标 VB能不能实现字符串链表? 屏幕取词问题 干不下去,改行准备做烟草生意! vb 处理数据问题 简单问题:请教大家在VB中如何实现数组做属性 急救:如何用sql server 建立 Access 中的交叉表?? 紧急求助!控件的问题!请各位高手帮忙! 关于vb在win98下面运行问题,各位大侠请指点一下啊。
Private datPrimaryRS As ADODB.Recordset
' 打开连接
sSQL = "select dw_bm,dw_mc from dw_table where dw_mc like'%" & Text1.Text & "%' order by dw_bm"
sConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\计划管理系统.mdb;Persist Security Info=False"
Set dfwConn = New Connection
dfwConn.Open sConnect ' 使用提供的集合创建 recordset
Set datPrimaryRS = New Recordset
datPrimaryRS.CursorLocation = adUseClient
datPrimaryRS.Open sSQL, dfwConn, adOpenForwardOnly, adLockReadOnly
Set MSHFlexGrid1.DataSource = datPrimaryRS
With MSHFlexGrid1
Select Case Combo1.ListIndex
Case 0
.FormatString = "单位编码|单位名称"
.Redraw = False
' 设置网格列宽度
.ColWidth(0) = 1000
.ColWidth(1) = 3000
End Select
' 设置网格列合并和排序
For i = 0 To .Cols - 1
.MergeCol(i) = True
Next i
.Sort = flexSortGenericAscending
' 设置网格样式
.AllowBigSelection = True
.FillStyle = flexFillRepeat
' 将标头作成粗体
.Row = 0
.Col = 0
.RowSel = .FixedRows - 1
.ColSel = .Cols - 1
.CellFontBold = True
' 隔列变灰
For i = .FixedCols To .Cols() - 1 Step 2
.Col = i
.Row = .FixedRows
.RowSel = .Rows - 1
.CellBackColor = &HC0C0C0 ' 浅灰
Next i
.AllowBigSelection = False
.FillStyle = flexFillSingle
.Redraw = True
End With
datPrimaryRS.Close
Set datPrimaryRS = Nothing