本帖最后由 jycel 于 2009-6-20 18:41 编辑
如图:先还是为是普通按钮做成的!在帮助中找到了很多TOOLBAR的函数,里面全是英文,没有找到可修改图标的地方!还有个问题就是对中文不完全支持,只显示一半,不会又得转换一次?#include <GuiToolbar.au3>
#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>
Opt('MustDeclareVars', 1)
$Debug_TB = False ; Check ClassName being passed to functions, set to True and use a handle to another control to see it work
_Main()
Func _Main()
Local $hGUI, $hToolbar, $aStrings[4]
Local Enum $idNew = 1000, $idOpen, $idSave, $idHelp
; Create GUI
$hGUI = GUICreate("Toolbar", 400, 300)
$hToolbar = _GUICtrlToolbar_Create ($hGUI)
GUISetState()
; Add standard system bitmaps
_GUICtrlToolbar_AddBitmap ($hToolbar, 1, -1, $IDB_STD_LARGE_COLOR)
; Add strings
$aStrings[0] = _GUICtrlToolbar_AddString ($hToolbar, "&中华人民共和国中华人民共和国")
$aStrings[1] = _GUICtrlToolbar_AddString ($hToolbar, "&Open")
$aStrings[2] = _GUICtrlToolbar_AddString ($hToolbar, "&Save")
$aStrings[3] = _GUICtrlToolbar_AddString ($hToolbar, "&Help")
; Add buttons
_GUICtrlToolbar_AddButton ($hToolbar, $idNew, $STD_FILENEW, $aStrings[0])
_GUICtrlToolbar_AddButton ($hToolbar, $idOpen, $STD_FILEOPEN, $aStrings[1])
_GUICtrlToolbar_AddButton ($hToolbar, $idSave, $STD_FILESAVE, $aStrings[2])
_GUICtrlToolbar_AddButtonSep ($hToolbar)
_GUICtrlToolbar_AddButton ($hToolbar, $idHelp, $STD_HELP, $aStrings[3])
; Loop until user exits
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc ;==>_Main
|