Jump to content

Alternative to GuiCtrlCreateButton/SetImage


Damein
 Share

Recommended Posts

In a previous post I requested help on fixing my script to allow me to use an image as a button. Since no one can figure out why it is not working, I am forced to find an alternative. Are there any UDF's or other things I may use to allow ANY image to be used as a button? Or just another alternative I can try would be great. Thank you.

MCR.jpg?t=1286371579

Most recent sig. I made

Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

Link to comment
Share on other sites

  • 3 weeks later...

Just download http://autoit.de/index.php?page=Attachment&attachmentID=12179&h=7455a4687f6f30dfb3dc227dbd7fa2fa42386984 and try this little script:

;author großvater
;modified autoBert
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include "GUICtrlPic.au3"
$bFirst = True
$Pic1 = @ProgramFilesDir & "AutoIt3ExamplesGUITorus.png"
$Form1 = GUICreate("Form1", 400, 300)
GUICtrlCreatePic(@ProgramFilesDir & "AutoIt3ExamplesGUImsoobe.jpg", 0, 0, 400, 300)
GuiCtrlSetState(-1,$GUI_DISABLE)
$a8 = _GUICtrlPic_Create($Pic1 , 30, 30, 72, 72, BitOR($SS_CENTERIMAGE,$SS_SUNKEN, $SS_NOTIFY), Default)
GUISetState(@SW_SHOW)


While 1
    $nMsg = GUIGetMsg()
    if $nMsg <> 0 Then ConsoleWrite($nMsg & @crlf)
    switch $nMsg
        case $GUI_EVENT_CLOSE
            Exit
        Case $a8
            if $bFirst Then
                _GUICtrlPic_SetImage($a8, @ProgramFilesDir & "AutoIt3ExamplesGUIMerlin.gif", 1)
            Else
                _GUICtrlPic_SetImage($a8, @ProgramFilesDir & "AutoIt3ExamplesGUITorus.png", 1)
            EndIf
            $bFirst = not $bFirst
    EndSwitch
WEnd
link to the thread

Link to comment
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
 Share

  • Recently Browsing   0 members

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