设置控件的位图或图标.
GUICtrlSetImage ( 控件ID, 文件名 [, 图标名 [, 图标类型]]
)
控件ID | 由 GUICtrlCreate... 函数返回的控件标识符. |
文件名 | 包含图片的文件名. |
图标名 | [可选参数] 文件包含多个图标时的图标名称. 如为图标序号, 则可以是负数. 否则设为 -1. |
图标类型 | [可选参数] 图标大小: 0 = 小图标, 1 = 正常(默认). 对于 TreeViewItem 则: 2 = 项目选中, 4 = 项目非选中. |
成功: | 返回 1. |
失败: | 返回 0. |
#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>
Example()
Func Example()
Local
$msg
GUICreate("我的
GUI") ; 创建居中显示的 GUI
窗口
GUICtrlCreateButton("我的图片按钮", 10,
20, 40, 40, $BS_ICON)
GUICtrlSetImage(-1, "shell32.dll", 22)
GUISetState()
; 运行 GUI, 直到
GUI 被关闭
While
1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
EndFunc ;==>Example
provider with jb51.net (unicode) |