首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 网站建设 > PHP > MSHFlexGrid的表头合并(VB中和VS2005中)
【标  题】:MSHFlexGrid的表头合并(VB中和VS2005中)
【关键字】:MSHFlexGrid,VB,VS2005
【来  源】:http://blog.csdn.net/yumanqing/archive/2006/12/22/1453633.aspx

MSHFlexGrid的表头合并(VB中和VS2005中)

Dim lngIndex As Long
    
Dim lngRow As Long
    
    
With MSHFlexGrid1
        .Rows 
= 13
        .Cols 
= 15
        .MergeCells 
= flexMergeFree '?????????
        
        .TextMatrix(
00= "拟晋升专业"
        .TextMatrix(
10= "拟晋升专业"
        
        
        
For lngIndex = 1 To 6
            .TextMatrix(
0, lngIndex) = "拟晋升职称级别"
        
Next
        .TextMatrix(
11= "小计"
        .TextMatrix(
12= "正高"
        .TextMatrix(
13= "副高"
        .TextMatrix(
14= "中级"
        .TextMatrix(
15= "助师级"
        .TextMatrix(
16= "员级"
        
        
For lngIndex = 7 To 11
            .TextMatrix(
0, lngIndex) = "晋 升 方 式"
        
Next
        .TextMatrix(
17= "正常晋升"
        .TextMatrix(
18= "学历破格"
        .TextMatrix(
19= "年限破格"
        .TextMatrix(
110= "学历年限破格"
        .TextMatrix(
111= "其他"

        .TextMatrix(
012= "联系人"
        .TextMatrix(
112= "联系人"
        .TextMatrix(
013= "联系电话"
        .TextMatrix(
113= "联系电话"
        .TextMatrix(
014= "备注"
        .TextMatrix(
114= "备注"
'
        .MergeRow(0= True
        .MergeCol(
0= True
        .MergeCol(
12= True
        .MergeCol(
13= True
        .MergeCol(
14= True
        
For lngRow = 0 To 1
            
For lngIndex = 0 To 14
                .Row 
= lngRow
                .Col 
= lngIndex
                .CellAlignment 
= flexAlignCenterCenter
                .ColAlignment(lngIndex) 
= flexAlignCenterCenter
            
Next
        
Next
''        .RowHeight(0) = 0
'
        .ColWidth(0) = 1800
'
        For lngIndex = 1 To 6
'
            .ColWidth(lngIndex) = 600
'
        Next
'
        For lngIndex = 7 To 11
'
            .ColWidth(lngIndex) = 1000
'
        Next
'
        .ColWidth(12) = 1000
'
        .ColWidth(13) = 1600
'
        .ColWidth(14) = 1600
        
    
End With

 见与在VS2005中的WINFORM中的DATAGRIEVIEW的表头没有合并的功能,同样可以把VB6中的着个控件添加进来

,实现同样的效果,下面是在VS2005中的C#实现合并功能的代码

 

       long lngIndex;
        
long lngRow;

        axMSHFlexGrid1.Rows
=3;
        axMSHFlexGrid1.FixedRows 
= 2;
        axMSHFlexGrid1.set_RowHeight(
0400);
        axMSHFlexGrid1.set_RowHeight(
1300);
        axMSHFlexGrid1.set_Cols(
15);
            
        axMSHFlexGrid1.MergeCells 
= MSHierarchicalFlexGridLib.MergeCellsSettings.flexMergeFree; // '?????????
          
        axMSHFlexGrid1.set_TextMatrix(
00,"项目");
        axMSHFlexGrid1.set_TextMatrix(
10"项目");
        axMSHFlexGrid1.set_TextMatrix(
01"单位");
        axMSHFlexGrid1.set_TextMatrix(
11"单位");
        axMSHFlexGrid1.set_TextMatrix(
02"年计划");
        axMSHFlexGrid1.set_TextMatrix(
12"年计划");


        
for(lngIndex = 3;lngIndex<9;lngIndex++)
        
{
            axMSHFlexGrid1.set_TextMatrix(
0, (int)lngIndex,"实际完成");
         }

         axMSHFlexGrid1.set_TextMatrix(
13"报表反映");
         axMSHFlexGrid1.set_TextMatrix(
14"人员买断及财产损失");
         axMSHFlexGrid1.set_TextMatrix(
15"经营实级");
         axMSHFlexGrid1.set_TextMatrix(
16"上年同期");
         axMSHFlexGrid1.set_TextMatrix(
17"同比增减");
         axMSHFlexGrid1.set_TextMatrix(
18"增件率(%)");
        
        
for(lngIndex = 9;lngIndex<14;lngIndex++)
        
{
            axMSHFlexGrid1.set_TextMatrix(
0, (int)lngIndex,"箱平担平(元)");
        }

        axMSHFlexGrid1.set_TextMatrix(
19"本年实际");
        axMSHFlexGrid1.set_TextMatrix(
110"年计划");
        axMSHFlexGrid1.set_TextMatrix(
111"与计划比增减");
        axMSHFlexGrid1.set_TextMatrix(
112,"上年同期");
        axMSHFlexGrid1.set_TextMatrix(
113,"同比增减(+ -)");

        
//axMSHFlexGrid1.set_TextMatrix(0, 12,"联系人");
        
//axMSHFlexGrid1.set_TextMatrix(1, 12,"联系人");
        
//axMSHFlexGrid1.set_TextMatrix(0, 13,"联系电话");
        
//axMSHFlexGrid1.set_TextMatrix(1, 13,"联系电话");
        
//axMSHFlexGrid1.set_TextMatrix(0, 14,"备注");
        axMSHFlexGrid1.set_TextMatrix(014"完成年计划(%)");
        axMSHFlexGrid1.set_TextMatrix(
114"完成年计划(%)");

        axMSHFlexGrid1.set_MergeRow(
0,true);
        axMSHFlexGrid1.set_MergeCol(
0true);
        
//axMSHFlexGrid1.set_MergeRow(1, true);
        axMSHFlexGrid1.set_MergeCol(1true);
        
//axMSHFlexGrid1.set_MergeRow(2, true);
        axMSHFlexGrid1.set_MergeCol(2true);
        axMSHFlexGrid1.set_MergeCol(
13true);
        axMSHFlexGrid1.set_MergeCol(
14,true);

        
//for (lngRow = 0; lngRow < 2; lngRow++)
        
//{
        
//    for( lngIndex = 0;lngIndex<15;lngIndex++)
        
//    {
        
//        axMSHFlexGrid1.Row = (int)lngRow;
               
        
//        axMSHFlexGrid1.set_Cols((int)lngIndex);
                
        
//       // axMSHFlexGrid1.CellAlignment = MSHierarchicalFlexGridLib.AlignmentSettings.flexAlignCenterCenter;
        
//       // axMSHFlexGrid1.CellAlignment = 2;
        
//        //axMSHFlexGrid1.set_FixedAlignment((int)lngIndex,2);
        
//        //axMSHFlexGrid1.set_FixedAlignment((int)lngIndex, MSHierarchicalFlexGridLib.AlignmentSettings.flexAlignCenterCenter);
        
//    }
        
//}
/*       .RowHeight(0) = 0
//       .ColWidth(0) = 1800
//       For lngIndex = 1 To 6
//            .ColWidth(lngIndex) = 600
//       Next
'        For lngIndex = 7 To 11
'            .ColWidth(lngIndex) = 1000
'        Next
'        .ColWidth(12) = 1000
'        .ColWidth(13) = 1600
'        .ColWidth(14) = 1600
*/

        
  
将数据库中表的数据按时间段导出为CSV文件的函数:【上一篇】
perl学习笔记 (1)perl常识:【下一篇】
【相关文章】
  • Upgrade Issue: Compile error C2327 with import dll under VC8/VS2005
  • 直接调用内置数据源连接对话框(VB.NET2005源码)
  • 用BAT和VBS搜集AD中的客户PC资料
  • VS2005探索二 Array
  • VS2003分页与VS2005分页的区别
  • adox 的vbs类,提取表名,列名等
  • VBScript常用函数(asp)第二部分
  • VB.NET能够转动任意角度的LABEL控件代码
  • VB.NET封装控件后提供给外部调用接口
  • VB.NET MDI画面中变化子画面显示的方法
  • 【随机文章】
  • Word 2000排版教你四招
  • Fedora Core 5和6 硬盘安装方法
  • 二叉排序
  • 克制Coding的冲动
  • oracle中如何将绝对秒数转换成具体的日期时间
  • 病毒杀不掉的原因以及处理方法
  • CCNP命令之BCRAN
  • HDS发布TagmaStore中端最新升级产品--AMS 1000
  • Core Java 2 Volume IIAdvanced Features 5th Edition
  • 重构一次后的EasyJWeb Tools辅助代码生成引擎功能及源码
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 软讯网络 All Rigths Reserved.