Jump to content
Sign in to follow this  
Kip

GUICtrlSetImage doesn't work

Recommended Posts

Kip

I want to set an image for a button:

#include <GUIConstants.au3>


$Left = 300
$Top = 150

$Form1 = GUICreate("Menu", 639, 21, $Left, $Top)
$MenuItem1 = GUICtrlCreateMenu("Bestand")
$MenuItem5 = GUICtrlCreateMenuItem("MenuItem5", $MenuItem1)
$MenuItem8 = GUICtrlCreateMenuItem("MenuItem8", $MenuItem1)
$MenuItem7 = GUICtrlCreateMenuItem("MenuItem7", $MenuItem1)
$MenuItem6 = GUICtrlCreateMenuItem("MenuItem6", $MenuItem1)
$MenuItem2 = GUICtrlCreateMenu("Beeld")
$MenuItem9 = GUICtrlCreateMenuItem("MenuItem9", $MenuItem2)
$MenuItem3 = GUICtrlCreateMenu("Opties")
$MenuItem10 = GUICtrlCreateMenuItem("MenuItem10", $MenuItem3)
$MenuItem4 = GUICtrlCreateMenu("Help")
$MenuItem11 = GUICtrlCreateMenuItem("MenuItem11", $MenuItem4)
$MenuItem12 = GUICtrlCreateMenuItem("MenuItem12", $MenuItem4)
GUISetState(@SW_SHOW)

$Form2 = GUICreate("Speler", 639, 118+24, $Left, $Top+47, BitOr($WS_POPUP,$WS_BORDER))
GUICtrlCreatePic("IMG/Header.bmp",0,0,639,24)
$Slider1 = GUICtrlCreateSlider(56, 64+24, 577, 25, BitOR($TBS_AUTOTICKS,$TBS_NOTICKS))
GUICtrlSetTip(-1, "Afspeelvoortgang")
$Progress1 = GUICtrlCreateProgress(8, 8+24, 17, 105, BitOR($PBS_SMOOTH,$PBS_VERTICAL))
GUICtrlSetData(-1, 25)
$Slider2 = GUICtrlCreateSlider(32, 8+24, 17, 105, BitOR($TBS_VERT,$TBS_AUTOTICKS,$TBS_TOP,$TBS_LEFT,$TBS_NOTICKS))
GUICtrlSetTip(-1, "Volume")
$Label1 = GUICtrlCreateLabel("Titel", 64, 8+24, 144, 17)
$Label2 = GUICtrlCreateLabel("Auteur", 64, 24+24, 139, 17)
$Label3 = GUICtrlCreateLabel("Duur", 64, 40+24, 139, 17)
$Button1 = GUICtrlCreateButton("Play", 64, 96+24, 100, 24, 0,$BS_BITMAP)
GUICtrlSetImage(-1,"IMG\Play.bmp") ; <---<---<---<---<---<---<---<---<---<---<---<---<---<---Here<---<---<---<---<---<---
$Button2 = GUICtrlCreateButton("Stop", 152, 96+24, 81, 17, 0)
$Button3 = GUICtrlCreateButton("Vorige", 240, 96+24, 81, 17, 0)
$Button4 = GUICtrlCreateButton("Volgende", 328, 96+24, 81, 17, 0)
GUISetState(@SW_SHOW)


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

That's the whole script, but it only shows an standard button, not an image :)

Edited by kip

Share this post


Link to post
Share on other sites
Valuater

Not Correct

$Button1 = GUICtrlCreateButton("Play", 64, 96+24, 100, 24, 0,$BS_BITMAP)

Corrected

$Button1 = GUICtrlCreateButton("Play", 64, 96+24, 100, 24, $BS_BITMAP)

Its a Style, not an extended Style

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×