本帖最后由 smooth 于 2022-4-7 15:52 编辑
GuictrlcreateList选中的项目,能否在鼠标点击控件外其他地方后取消选中状态?能否点击右键出现复制选项?
我这几天把有关的的函数,自定义函数,样式、扩展样式都捋了几遍,然后每天在论坛、百度里查,就是没找到方法。
有懂的大神,麻烦提点一下,哪怕思路也行,谢谢了!#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
Example()
Func Example()
Local $sMESSAGE = "The following buttons have been clicked"
GUICreate("My GUI list") ; will create a dialog box that when displayed is centered
Local $idButton_Add = GUICtrlCreateButton("Add", 64, 32, 75, 25)
Local $idButton_Clear = GUICtrlCreateButton("Clear", 64, 72, 75, 25)
Local $idMylist = GUICtrlCreateList("buttons that have been clicked", 176, 32, 121, 97)
GUICtrlSetLimit(-1, 200) ; to limit horizontal scrolling
GUICtrlSetData(-1, $sMESSAGE)
Local $idButton_Close = GUICtrlCreateButton("my closing button", 64, 160, 175, 25)
GUISetState(@SW_SHOW)
; Loop until the user exits.
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
Case $idButton_Add
GUICtrlSetData($idMylist, "You clicked button No1|")
Case $idButton_Clear
GUICtrlSetData($idMylist, "")
Case $idButton_Close
MsgBox($MB_SYSTEMMODAL, "", "the closing button has been clicked", 2)
Exit
EndSwitch
WEnd
EndFunc ;==>Example
|