找回密码
 加入
搜索
查看: 1955|回复: 7

关于GUICtrlCreateList背景加暗条

  [复制链接]
发表于 2009-12-13 15:33:23 | 显示全部楼层 |阅读模式
$hListView = GUICtrlCreateListView($GUI, "连接数(0)", 10, 10, 300, 180)
GUICtrlCreateListView 添加暗调函数为:
_GUICtrlListView_SetExtendedListViewStyle($hListView, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT))

但不知道 GUICtrlCreateList 要填写以上样式应该如何 写!!!  
套用_GUICtrlListView_SetExtendedListViewStyle  直接就是报错
发表于 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?
 楼主| 发表于 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


不可用啊 。。 我现在要对GUICtrlCreateList 创建的表加暗条。。
发表于 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
只是随便写的,自己看着改吧
 楼主| 发表于 2009-12-13 17:53:33 | 显示全部楼层
回复  zhenglei

#include
#include
#include
local $GUI
$Form1 = GUICreate("www", 633, 460,  ...
netegg 发表于 2009-12-13 17:38


老大。。 我知道用GUICtrlCreateListViewItem建立的表可以实现这个功能,
但我要用这个GUICtrlCreateList 如何实现那个功能
发表于 2009-12-13 18:06:51 | 显示全部楼层
本帖最后由 netegg 于 2009-12-13 18:10 编辑

帮助里udf的listview那个例子不就是嘛,把列数变成1,宽度不可变,不就是list了
 楼主| 发表于 2009-12-18 15:40:29 | 显示全部楼层
帮助里udf的listview那个例子不就是嘛,把列数变成1,宽度不可变,不就是list了
netegg 发表于 2009-12-13 18:06



    具体是怎么个弄法。 麻烦详细说明。 举例子最好。 你说的那个我找不到。。也不知道怎么套用
发表于 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

只是把帮助里的例子该了改,看看合不合要求
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-22 15:34 , Processed in 0.080096 second(s), 22 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表