zhenglei 发表于 2009-12-13 15:33:23

关于GUICtrlCreateList背景加暗条

$hListView = GUICtrlCreateListView($GUI, "连接数(0)", 10, 10, 300, 180)
GUICtrlCreateListView 添加暗调函数为:
_GUICtrlListView_SetExtendedListViewStyle($hListView, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT))

但不知道 GUICtrlCreateList 要填写以上样式应该如何 写!!!
套用_GUICtrlListView_SetExtendedListViewStyle直接就是报错

netegg 发表于 2009-12-13 15:43:16

本帖最后由 netegg 于 2009-12-13 15:45 编辑

GUICtrlSetStyle($Gui, bitor($GUI_SS_DEFAULT_LISTVIEW, $LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT))没试过,试试看
另外,可以在创建控件的时候直接设置,为什么要用setstyle?

zhenglei 发表于 2009-12-13 15:54:22

GUICtrlSetStyle($Gui, bitor($GUI_SS_DEFAULT_LISTVIEW, $LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT)) ...
netegg 发表于 2009-12-13 15:43 http://www.autoitx.com/images/common/back.gif

不可用啊 。。 我现在要对GUICtrlCreateList 创建的表加暗条。。

netegg 发表于 2009-12-13 17:38:43

回复 3# zhenglei

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ListViewConstants.au3>
local $GUI
$Form1 = GUICreate("www", 633, 460, 192, 113, BitOR($WS_SYSMENU, $WS_CAPTION, $WS_POPUP, $WS_POPUPWINDOW, $WS_BORDER, $WS_CLIPSIBLINGS))
$GUI = GUICtrlCreateListView("连接数(0)|wo|ae|ew|rt|we|we|ee|ww|", 10, 10, 300, 180, $GUI_SS_DEFAULT_LISTVIEW,$LVS_EX_GRIDLINES)
GUICtrlCreateListViewItem("a|a|a|a|a|aa|a|a|a|a|", $GUI)
GUISetState()
While 1
        sleep(100)
WEnd
只是随便写的,自己看着改吧

zhenglei 发表于 2009-12-13 17:53:33

回复zhenglei

#include
#include
#include
local $GUI
$Form1 = GUICreate("www", 633, 460,...
netegg 发表于 2009-12-13 17:38 http://www.autoitx.com/images/common/back.gif

老大。。 我知道用GUICtrlCreateListViewItem建立的表可以实现这个功能,
但我要用这个GUICtrlCreateList 如何实现那个功能

netegg 发表于 2009-12-13 18:06:51

本帖最后由 netegg 于 2009-12-13 18:10 编辑

帮助里udf的listview那个例子不就是嘛,把列数变成1,宽度不可变,不就是list了

zhenglei 发表于 2009-12-18 15:40:29

帮助里udf的listview那个例子不就是嘛,把列数变成1,宽度不可变,不就是list了
netegg 发表于 2009-12-13 18:06 http://www.autoitx.com/images/common/back.gif


    具体是怎么个弄法。 麻烦详细说明。 举例子最好。 你说的那个我找不到。。也不知道怎么套用

netegg 发表于 2009-12-18 16:48:43

本帖最后由 netegg 于 2009-12-18 16:55 编辑

#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GuiConstantsEx.au3>
#include <GuiListView.au3>
#include <WindowsConstants.au3>

Opt('MustDeclareVars', 1)

$Debug_LV = False ; Check ClassName being passed to ListView functions, set to True and use a handle to another control to see it work

Global $hListView

_Main()

Func _Main()

        Local $GUI
        $GUI = GUICreate("(UDF Created) ListView Create", 400, 300)

        $hListView = _GUICtrlListView_Create($GUI, "", 2, 2, 394, 268)
        _GUICtrlListView_SetExtendedListViewStyle($hListView, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT))
        GUISetState()
       

        ; Load images

        ; Add columns
        _GUICtrlListView_InsertColumn($hListView, 0, "Column 1", 400)
        _GUICtrlListView_InsertColumn($hListView, 0, "Column 1", 400)
        _GUICtrlListView_AddItem($hListView, "Row 1: Col 1", 0)
        _GUICtrlListView_AddItem($hListView, "Row 2: Col 1", 1)
        _GUICtrlListView_AddItem($hListView, "Row 3: Col 1", 2)

        ; Loop until user exits
        Do
        Until GUIGetMsg() = $GUI_EVENT_CLOSE
        GUIDelete()
EndFunc   ;==>_Main

只是把帮助里的例子该了改,看看合不合要求
页: [1]
查看完整版本: 关于GUICtrlCreateList背景加暗条