Jump to content

Recommended Posts

Posted

Hello, I was trying to create a toolbar with images from an Imagelist, but I can not get the buttons background grey.

Any help will be appreciated.

Happy new year for this wonderfull comunity. :x

#include <GuiToolbar.au3>

#include <GuiImageList.au3>

#include <GuiConstantsEx.au3>

#include <WindowsConstants.au3>

Local $hGUI, $hToolbar, $hNormal, $hDisabled, $hHot,$hImage

Local Enum $idNew = 1000, $id1,$id2,$id3,$id4,$id5,$id6

; Create GUI

$hGUI = GUICreate("Toolbar", 400, 300)

;GUISetBkColor(0xffff00)

$hToolbar = _GUICtrlToolbar_Create($hGUI)

; Create image list

$hImage = _GUIImageList_Create(16,16)

;_GUIImageList_SetBkColor($hImage, $CLR_NONE)

;_GUIImageList_AddMasked($hImage, _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 0xfcfcfc,110)) ;

_GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 110)

_GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 131)

_GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 165)

_GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 168)

_GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 137)

_GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 146)

_GUIImageList_SetBkColor($hImage, $CLR_NONE)

_GUICtrlToolbar_SetImageList($hToolbar, $hImage)

; Add buttons

_GUICtrlToolbar_AddButton($hToolbar, $id1,0)

_GUICtrlToolbar_AddButton($hToolbar, $id2,1)

_GUICtrlToolbar_AddButtonSep ($hToolbar)

_GUICtrlToolbar_AddButton($hToolbar, $id3,2)

_GUICtrlToolbar_AddButton($hToolbar, $id4,3)

_GUICtrlToolbar_AddButtonSep ($hToolbar)

_GUICtrlToolbar_AddButton($hToolbar, $id5,4)

_GUICtrlToolbar_AddButton($hToolbar, $id6,5)

;$fStyle = _GUICtrlToolbar_GetStyleTransparent($hToolbar)

;_GUICtrlToolbar_SetStyleTransparent($hToolbar, $fStyle)

;_GUICtrlToolbar_SetColorScheme($hToolbar, 0x00ffff, 0x800000)

GUISetState()

Do

Until GUIGetMsg() = $GUI_EVENT_CLOSE

Posted

help file entry for _GUIImageList_Create()

Image color depth:

5 - Use a 32 bit DIB section

$hImage = _GUIImageList_Create(16, 16, 5)

I see fascists...

Posted

Rover, thanks a lot for the help. It works fine know. I read help file but I did not understand

I had to use this parameter.

Happy new year for you and your family. :x

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...