| 发表于: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 | | |
|