Verssuss

Fast topic. Clickable picture in GUI

4 posts in this topic

#1 ·  Posted

like title is. i cant find answer. i know there is something with eventmode or like this

THANKS

Share this post


Link to post
Share on other sites



#2 ·  Posted

Use Switch.. Case.. Endswitch

 

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 437, 192, 124)
$Pic1 = GUICtrlCreatePic("C:\Users\Andrea\Pictures\Uplay\For Honor - Open Beta\For Honor - Open Beta2017-2-10-18-48-25.jpg", 224, 112, 100, 100)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

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

Here is "Case $Pic1" which means "when you click that control (in out case $Pic1)

Hope you understand :)

1 person likes this

Share this post


Link to post
Share on other sites

#3 ·  Posted

i just did it by myself right after i post but help anyway xD

.Closed

Share this post


Link to post
Share on other sites

#4 ·  Posted

Hello

Warning ! Do this test WITHOUT the image file.

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 437, 192, 124)
$Pic1 = GUICtrlCreatePic("C:\Users\Andrea\Pictures\Uplay\For Honor - Open Beta\For Honor - Open Beta2017-2-10-18-48-25.jpg", 224, 112, 100, 100)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Pic1
            Sleep (5000)
            beep()
    EndSwitch
WEnd

Do you understand why?
cordially

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