|
发表于 2016-9-5 16:02:11
|
显示全部楼层
回复 7# kk_lee69
用 BUTTON 模仿出工具栏
#include <GuiToolbar.au3>
#include <GuiMenu.au3>
#include <GuiToolTip.au3>
#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
#include <GUIComboBox.au3>
#include <Constants.au3>
#include <GuiImageList.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <FontConstants.au3>
#include <GuiButton.au3>
;Opt("GUIOnEventMode", 0)
Global $iCmdID, $hWndGUI, $MsgID, $wParam, $lParam, $e_idSave, $aStrings[5]
$WinSub = GUICreate(" 基本数据设定", 800, 600, -1, -1, BitOR($WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_SYSMENU, $WS_GROUP, $WS_TABSTOP), -1);BitOR($WS_CHILD, $WS_MINIMIZEBOX, $WS_CAPTION, $WS_SYSMENU)
$Button1 = GUICtrlCreateLabel("新增按钮", 10, 60, 60, 30)
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlSetBkColor(-1, -2)
GUICtrlSetCursor(-1, 0)
$MenButton1 = GUICtrlCreateButton("", 10, 5, 48, 48, $WS_EX_WINDOWEDGE)
$hImage = _GUIImageList_Create(40, 40, 5, 1, 0)
_GUICtrlButton_SetImageList($MenButton1, _set_button_image_maxx(39), 5)
$Button2 = GUICtrlCreateLabel("存档按钮", 80, 60, 60, 30)
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlSetBkColor(-1, -2)
GUICtrlSetCursor(-1, 0)
$MenButton2 = GUICtrlCreateButton("", 80, 5, 48, 48, $WS_EX_WINDOWEDGE)
$hImage = _GUIImageList_Create(40, 40, 5, 1, 0)
_GUICtrlButton_SetImageList($MenButton2, _set_button_image_maxx(20), 5)
$Label1 = GUICtrlCreateLabel("_", 0, 76, @DesktopWidth, 1, 0x1000) ;线条的部份
GUICtrlSetResizing(-1,802)
GUISetState()
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
Case $Button1, $MenButton1
;MsgBox(0, "信息", "按钮选择状态: " & _GUICtrlToolbar_IsButtonChecked($hToolbarSub, $e_idSave))
;GUISetState(@SW_DISABLE, $WinSub) ; 禁用窗口,以防用户作出其他更改
MsgBox(0, "", "新增按钮")
;WinActivate($WinSub, "")
;GUISetState(@SW_ENABLE, $WinSub) ; 使窗口重新可用
Case $Button2, $MenButton2
MsgBox(0, "", "存档按钮")
EndSwitch
WEnd
Func _set_button_image_maxx($icon_index)
Local $hImage_Temp = _GUIImageList_Create(40, 40, 5, 3, 6)
_GUIImageList_AddIcon($hImage_Temp, "Shell32.dll", $icon_index, True)
Return $hImage_Temp
EndFunc ;==>_set_button_image_maxx |
|