設(shè)置控件的位圖或圖標(biāo).
GUICtrlSetImage ( 控件ID, 文件名 [, 圖標(biāo)名 [, 圖標(biāo)類型]]
)
控件ID | 由 GUICtrlCreate... 函數(shù)返回的控件標(biāo)識(shí)符. |
文件名 | 包含圖片的文件名. |
圖標(biāo)名 | [可選參數(shù)] 文件包含多個(gè)圖標(biāo)時(shí)的圖標(biāo)名稱. 如為圖標(biāo)序號(hào), 則可以是負(fù)數(shù). 否則設(shè)為 -1. |
圖標(biāo)類型 | [可選參數(shù)] 圖標(biāo)大小: 0 = 小圖標(biāo), 1 = 正常(默認(rèn)). 對(duì)于 TreeViewItem 則: 2 = 項(xiàng)目選中, 4 = 項(xiàng)目非選中. |
成功: | 返回 1. |
失敗: | 返回 0. |
#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>
Example()
Func Example()
Local
$msg
GUICreate("我的
GUI") ; 創(chuàng)建居中顯示的 GUI
窗口
GUICtrlCreateButton("我的圖片按鈕", 10,
20, 40, 40, $BS_ICON)
GUICtrlSetImage(-1, "shell32.dll", 22)
GUISetState()
; 運(yùn)行 GUI, 直到
GUI 被關(guān)閉
While
1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
EndFunc ;==>Example
provider with jb51.net (unicode) |