Jump to content

Recommended Posts

Posted

the attached file is what is supposed to be a multi-res icon containing 2 images; 64x64 and 128x128, created with GIMP and exported as an ico file

i'm having trouble trying to get GUICtrlSetImage to apply the correct icon for the buttons - in my case, the 128 icon is never displayed and i don't know why

#include <ButtonConstants.au3>

Global $Form1 = GUICreate("Form1", 900, 300, -1, -1)
Global $Button1 = GUICtrlCreateButton("", 0, 28, 128, 128, $BS_ICON)
GUICtrlSetImage(-1, @ScriptDir & "\icon.ico", "ico128")
Global $Button1 = GUICtrlCreateButton("", 125, 28, 128, 128, $BS_ICON)
GUICtrlSetImage(-1, @ScriptDir & "\icon.ico", -1)
Global $Button1 = GUICtrlCreateButton("", 250, 28, 128, 128, $BS_ICON)
GUICtrlSetImage(-1, @ScriptDir & "\icon.ico", -2)
Global $Button1 = GUICtrlCreateButton("", 375, 28, 128, 128, $BS_ICON)
GUICtrlSetImage(-1, @ScriptDir & "\icon.ico")
Global $Button1 = GUICtrlCreateButton("", 500, 28, 128, 128, $BS_ICON)
GUICtrlSetImage(-1, @ScriptDir & "\icon.ico", -1, 0)
Global $Button1 = GUICtrlCreateButton("", 625, 28, 128, 128, $BS_ICON)
GUICtrlSetImage(-1, @ScriptDir & "\icon.ico", -1, 1)
Global $Button1 = GUICtrlCreateButton("", 750, 28, 128, 128, $BS_ICON)
GUICtrlSetImage(-1, @ScriptDir & "\icon.ico", -1, 2)

Global $Button2 = GUICtrlCreateButton("", 0, 200, 64, 64, $BS_ICON)
GUICtrlSetImage(-1, @ScriptDir & "\icon.ico", "ico64")
Global $Button2 = GUICtrlCreateButton("", 100, 200, 64, 64, $BS_ICON)
GUICtrlSetImage(-1, @ScriptDir & "\icon.ico", -1)
Global $Button2 = GUICtrlCreateButton("", 200, 200, 64, 64, $BS_ICON)
GUICtrlSetImage(-1, @ScriptDir & "\icon.ico", -2)
Global $Button2 = GUICtrlCreateButton("", 300, 200, 64, 64, $BS_ICON)
GUICtrlSetImage(-1, @ScriptDir & "\icon.ico")
GUISetState(@SW_SHOW)

While 1
    Switch GUIGetMsg()
        Case -3
            Exit
    EndSwitch
WEnd

icon.ico

FUNCTIONS: WinDock (dock window to screen edge) | EditCtrl_ToggleLineWrap (line/word wrap for AU3 edit control) | SendEX (yet another alternative to Send( ) ) | Spell Checker (Hunspell wrapper) | SentenceCase (capitalize first letter of sentences)

CODE SNIPPITS: Dynamic tab width (set tab control width according to window width)

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
×
×
  • Create New...