我用这个MSFlexGrid1/MSHFlexGrid1 真头都痛呀?好象这类控件变化性很大?明明相同代码却得到结果不一样?为什么?
我用这个MSFlexGrid1/MSHFlexGrid1 真头都痛呀?我用这个MSFlexGrid1/MSHFlexGrid1 真头都痛呀?好象这类控件变化性很大?明明相同代码却显示结果不一样?为什么?
一会儿只能合并1-9行的,而不合并 上下 2行的固定标题行?? (即我的代码文字不能实现上下2行10-17列合并),
一会儿复制了别人的MSFlexGrid1控件时,能够实现文字居中,点击选中的行(整行字体为红色,背景色为白,比较美观,而我自己没有找到实现这样的功能代码...)
版主帮我看一下我的代码... (帮我实现上述两个功能的) (即我的代码文字不能居中,点击选中的行(整行字体不是红色,背景色为白,)
下面是我的代码
Public Sub xshowtitle()
If Combo1.Text <> "" Then
'思信厂PMC生产排期计划表
Label4.Caption = "生产排期" & Combo1.Text & "计划表"
End If
MSF1.Clear
Dim i As Integer
With MSF1
.Cols = 29
.Rows = 3
.FixedCols = 0
.FixedRows = 2
.MergeCells = flexMergeRestrictAll
'MSHFlexGrid.MergeCells = 2
' .FormatString = " | | | | | | | | | 10 | 11 | 12 | | | | "
.TextMatrix(0, 0) = ""
.TextMatrix(0, 1) = "接单日期 "
.TextMatrix(0, 2) = "工令单号 "
.TextMatrix(0, 3) = "OC号"
.TextMatrix(0, 4) = "PO号"
.TextMatrix(0, 5) = "ITEM号"
.TextMatrix(0, 6) = "客户名称"
.TextMatrix(0, 7) = "产品名称"
.TextMatrix(0, 8) = "数量"
.TextMatrix(0, 9) = "交货日期"
For i = 10 To 17
.TextMatrix(0, i) = Combo1.Text
Next
.TextMatrix(1, 1) = ""
.TextMatrix(1, 2) = ""
.TextMatrix(0, 18) = "总工价"
.TextMatrix(0, 19) = "总工时"
.TextMatrix(0, 20) = "工人数量"
.TextMatrix(0, 21) = "所需天数"
.TextMatrix(0, 22) = "预计开始期"
.TextMatrix(0, 23) = "预计完成期"
.TextMatrix(0, 24) = "实际开始日期"
.TextMatrix(0, 25) = "实际完成日期"
.TextMatrix(0, 26) = "已完成数"
.TextMatrix(0, 27) = "结余数量"
.TextMatrix(0, 28) = "备注"
Select Case Combo1.Text
Case "喷油部"
.TextMatrix(1, 10) = "大枪工价"
.TextMatrix(1, 11) = "小枪胭脂"
.TextMatrix(1, 12) = "手绘工价"
.TextMatrix(1, 13) = "抹油工价"
.TextMatrix(1, 14) = "其它部门1"
.TextMatrix(1, 15) = "其它部门2"
.TextMatrix(1, 16) = "其它部门3"
.TextMatrix(1, 17) = "其它部门4"
Case "吸塑部"
.TextMatrix(1, 10) = "吸塑部1"
.TextMatrix(1, 11) = "吸塑部1"
.TextMatrix(1, 12) = "吸塑部1"
.TextMatrix(1, 13) = "吸塑部1"
.TextMatrix(1, 14) = "其它部门1"
.TextMatrix(1, 15) = "其它部门2"
.TextMatrix(1, 16) = "其它部门3"
.TextMatrix(1, 17) = "其它部门4"
Case "装配部"
.TextMatrix(1, 10) = "装配部1"
.TextMatrix(1, 11) = "装配部1"
.TextMatrix(1, 12) = "装配部1"
.TextMatrix(1, 13) = "装配部1"
.TextMatrix(1, 14) = "其它部门1"
.TextMatrix(1, 15) = "其它部门2"
.TextMatrix(1, 16) = "其它部门3"
.TextMatrix(1, 17) = "其它部门4"
Case "橡胶部"
.TextMatrix(1, 10) = "橡胶部1"
.TextMatrix(1, 11) = "橡胶部1"
.TextMatrix(1, 12) = "橡胶部1"
.TextMatrix(1, 13) = "橡胶部1"
.TextMatrix(1, 14) = "其它部门1"
.TextMatrix(1, 15) = "其它部门2"
.TextMatrix(1, 16) = "其它部门3"
.TextMatrix(1, 17) = "其它部门4"
Case "包装部"
.TextMatrix(1, 10) = "包装部1"
.TextMatrix(1, 11) = "包装部1"
.TextMatrix(1, 12) = "包装部1"
.TextMatrix(1, 13) = "包装部1"
.TextMatrix(1, 14) = "其它部门1"
.TextMatrix(1, 15) = "其它部门2"
.TextMatrix(1, 16) = "其它部门3"
.TextMatrix(1, 17) = "其它部门4"
End Select
.MergeCol(0) = True
.MergeRow(0) = True
.MergeCol(1) = True
.MergeRow(1) = True
.ColWidth(0) = 50
.ColWidth(1) = 1100
.ColWidth(2) = 1300
.ColWidth(3) = 1500
.ColWidth(4) = 1100
.ColWidth(5) = 1600
.ColWidth(6) = 1600
.ColWidth(7) = 1600
.ColWidth(8) = 700
.ColWidth(9) = 1200
.ColWidth(10) = 1000
.ColWidth(11) = 1000
.ColWidth(12) = 1000
.ColWidth(13) = 1000
.ColWidth(14) = 1000
.ColWidth(15) = 1000
.ColWidth(16) = 1000
.ColWidth(17) = 1000
'.ColWidth(16) = 1500
For i = 1 To 15
.ColAlignment(i) = 4
Next i
.FillStyle = flexFillSingle
.Col = 0
.Row = 0
.RowSel = 1
.ColSel = .Cols - 1
.CellAlignment = 4
End With
End Sub