| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 605 人关注过本帖
标题:我用这个MSFlexGrid1/MSHFlexGrid1 真头都痛呀?好象这类控件变化性很大?明明 ...
取消只看楼主 加入收藏
yiyaozjk
Rank: 2
等 级:论坛游民
帖 子:231
专家分:30
注 册:2010-3-10
结帖率:51.67%
收藏
已结贴  问题点数:20 回复次数:1 
我用这个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
搜索更多相关主题的帖子: 背景色 
2011-12-16 22:51
yiyaozjk
Rank: 2
等 级:论坛游民
帖 子:231
专家分:30
注 册:2010-3-10
收藏
得分:0 
一会儿只能合并1-9行的,而不合并 上下 2行的固定标题行?? (即我的代码文字不能实现上下2行10-17列合并),

总不需要再添加什么事件了吧??为何不能合并呢???

其它事件能否帮忙添加一下......
2011-12-19 09:23
快速回复:我用这个MSFlexGrid1/MSHFlexGrid1 真头都痛呀?好象这类控件变化性很大 ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.020805 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved