热门在VB6中为MSFlexGrid添加新列 [英] Hot to add new column for MSFlexGrid in VB6

查看:251
本文介绍了热门在VB6中为MSFlexGrid添加新列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个MSFlexGrid控件(具有5个列和3行),该控件具有如下数据:

A B C D E
1 2 3 4 5
5 4 3 2 1
0 9 8 7 6
现在,我想将列F(没有数据)添加到C列之前和B列之后,如下所示:

A B F C D E
1 2-3 4 5
5 4-3 2 1
0 9-8 7 6
那么如何添加列F.如果使用datagrid,我可以添加它

I have a MSFlexGrid control (have 5 cols and 3 rows) that it had data as follow:

A B C D E
1 2 3 4 5
5 4 3 2 1
0 9 8 7 6
Now I want to addcolumn F(don''t have data) into before column C and after column B as follow:

A B F C D E
1 2 - 3 4 5
5 4 - 3 2 1
0 9 - 8 7 6
So how to add column F. If using datagrid i can add it

Dim dc
   Set dc = DataGrid1.Columns.Add(2)
   dc.Caption = "New Field"
   dc.DataField = "New Field"



但是使用MSFlexGrid我不能.
请问您能帮我一些代码吗?
感谢



but with MSFlexGrid I can not.
can you help me some code,pls?
thanks

推荐答案

只需添加

Grid.Columns = Grid.Columns +1

设置值:Grid.set_TextMatrix(0,Grid.Columns,新字段F")
Simply add

Grid.Columns = Grid.Columns +1

Set Value : Grid.set_TextMatrix(0, Grid.Columns, "New Field F")


这篇关于热门在VB6中为MSFlexGrid添加新列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆