那意思说 一行 只能一个CHECKBOX 喽
就是一列下来
linkuncool 发表于 2010-5-2 18:51 http://www.autoitx.com/images/common/back.gif
谁说的? ListView控件照样可以做一行多个复选框啊!
回复xuanfeng1234567
自己算下嘛
你看一行 有3个checkbox 每行的 checkbox纵坐标 都一样...
linkuncool 发表于 2010-5-2 18:49 http://www.autoitx.com/images/common/back.gif
大哥,你这不是误导人吗?不用这么麻烦吧,用LISTVIEW可以实现楼主的需要吧。#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_icon=C:\Program Files\Autoit3\Aut2Exe\Icons\netscape.ico
#AutoIt3Wrapper_UseAnsi=y
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#Include <GuiListBox.au3>
#Include <GuiListView.au3>
#Include <GuiImageList.au3>
$x = 730
$y = 571
$Form1 = GUICreate("Form1", $x, $y, 193, 125,$WS_OVERLAPPEDWINDOW)
$List1 = GUICtrlCreateListView("", 32, 32, $x-50, $y-40)
$Menu = GUICtrlCreateContextMenu($List1)
$About = GUICtrlCreateMenuItem("执行",$Menu)
$Refresh = GUICtrlCreateMenuItem("刷新",$Menu)
GUICtrlSetStyle($List1,BitOR($LVS_NOCOLUMNHEADER,$LVS_ICON,$LVS_SORTASCENDING,$LVS_SINGLESEL),$LVS_EX_CHECKBOXES)
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
$Image = _GUIImageList_Create(32,32,5)
For $i = 1 To 50
_GUIImageList_AddIcon($Image,"c:\WINDOWS\system32\shell32.dll",$i,True)
_GUICtrlListView_SetImageList($List1,$Image,0)
_GUICtrlListView_AddItem($List1,"第"&$i&"个",$i-1)
Next
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $About
$Index = _GUICtrlListView_GetSelectedIndices($List1)
If $Index <> "" Then
$L_Name = _GUICtrlListView_GetItemText($List1,Int($Index),0)
MsgBox(0,"鼠标右键",$Index&"你执行的是"&$L_Name)
EndIf
Case $Refresh
_GUICtrlListView_Arrange($List1,2)
Case $GUI_EVENT_MAXIMIZE
_GUICtrlListView_Arrange($List1,2)
Case $GUI_EVENT_RESTORE
_GUICtrlListView_Arrange($List1,2)
Case $GUI_EVENT_RESIZED
_GUICtrlListView_Arrange($List1,2)
EndSwitch
WEnd
Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $tInfo ,$Menu
$hWndListView = $List1
If Not IsHWnd($List1) Then $hWndListView = GUICtrlGetHandle($List1)
$tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
$hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
$iCode = DllStructGetData($tNMHDR, "Code")
Switch $hWndFrom
Case $hWndListView
Switch $iCode
Case $NM_DBLCLK ; 响应 List1 范围内的双击
$Index = _GUICtrlListView_GetSelectedIndices($hWndListView)
If $Index <> "" Then
$L_Name = _GUICtrlListView_GetItemText($hWndListView,$Index)
MsgBox(0,"响应双击","你选择的是"&$L_Name)
EndIf
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc 回复 15# xuanfeng1234567
呵呵 客气了 OK 谢谢解决了
谢谢大家喽 学习了...... 这个界面真的很漂亮。 占个位置学习学习 学习一下,以前也只认为每行只有一个CHECKBOX :face (18): 楼主的软件做的真不错啊。 ListView....比较简单实现
页:
1
[2]