您的位置:程序门 -> vb -> 控件



请问;listview控件怎么实现网格


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


请问;listview控件怎么实现网格[已结贴,结贴人:p1112]
发表于:2007-06-18 14:06:49 楼主
我用的是vb   6.0,怎么实现网格?
发表于:2007-06-18 14:11:011楼 得分:0
自己顶
发表于:2007-06-18 14:19:202楼 得分:25
listview1.view   =   lvwreport
        listview1.gridlines   =   true

别忘了添加列
发表于:2007-06-18 14:20:463楼 得分:0
增加列是:
右击窗口上的listview控件,选择属性,单击   列首   选项卡。
在那里可以插入
发表于:2007-06-18 14:26:504楼 得分:0
我怎么没找到gridlines   属性
发表于:2007-06-18 14:46:415楼 得分:0
我这有啊
我引用的是
microsoft   windows   common   controls   6.0   (sp6)
发表于:2007-06-18 14:55:526楼 得分:0
会不会是我的补丁没打?
发表于:2007-06-18 15:00:507楼 得分:0
谢谢,找到了
发表于:2007-06-18 15:06:598楼 得分:0
我要在listview里面显示很多列数据应该怎么实现?listview能实现吗?
发表于:2007-06-18 15:25:369楼 得分:15
这是listview基本的属性,补丁未打。
vb6最新补丁是sp6,2004年更新

for   microsoft   windows   common   controls   5.0   (sp2)   ---comctl32.dll
看不到gridlines   属性,但api能实现。
for   microsoft   windows   common   controls   6.0   (sp6)   ---mscomctl.dll
直接看到gridlines   属性。

private   const   lvs_ex_gridlines       as   long   =   &h1&
private   const   lvm_first                     as   long   =   &h1000
private   const   lvm_getextendedlistviewstyle   =   (lvm_first   +   55)
private   const   lvm_setextendedlistviewstyle   =   (lvm_first   +   54)
private   declare   function   sendmessagelonga   lib   "user32 "   alias   "sendmessagea "   (byval   hwnd   as   long,byval   wmsg   as   long,   byval   wparam   as   long,   byval   lparam   as   long)   as   long

public   sub   gridlines(byval   lvhwnd   as   long,byval   propval   as   boolean)
'*/   change   gridlines   state

        if   not   lvhwnd     =   0   then
                if   propval   then
                        setextendedstyle   lvs_ex_gridlines,   0
                else
                        setextendedstyle   0,   lvs_ex_gridlines
                end   if
        end   if
       
end   sub

private   sub   setextendedstyle(byval   lvhwnd   as   long,byval   lstyle   as   long,byval   lstylenot   as   long)
'*/   change   list   extended   style   params

dim   lnewstyle       as   long

        lnewstyle   =   sendmessagelonga(lvhwnd   ,   lvm_getextendedlistviewstyle,   0&,   0&)
        lnewstyle   =   lnewstyle   and   not   lstylenot
        lnewstyle   =   lnewstyle   or   lstyle
        sendmessagelonga   lvhwnd   ,   lvm_setextendedlistviewstyle,   0&,   lnewstyle

end   sub
发表于:2007-06-18 15:27:2310楼 得分:0
我已经找到了,我要在listview里面显示很多列数据应该怎么实现?listview能实现吗?
发表于:2007-06-18 16:43:4811楼 得分:0
怎么判断选中的是哪一级节点?大家帮忙啊
发表于:2007-06-18 17:00:1512楼 得分:0
能显示多列,添加列首是我上面说的方法。
你说的节点应该是   treeview     控件
listview没有这一说。

这是往新添加的行的每一列中写数据的方法

option   explicit

private   sub   form_load()
        with   listview1.listitems.add
                .text   =   "1 "
                .subitems(1)   =   "2 "
                .subitems(2)   =   "3 "
        end   with
end   sub
发表于:2007-06-19 13:01:5913楼 得分:0
谢谢2位,特别感谢wzzwwz(皮皮鲁)


快速检索

最新资讯
热门点击