Jump to content

Recommended Posts

Posted

I create image with

$Image1 = GUICtrlCreatePic("wv.gif", 30, 30, 35, 35)

Later I'd like to change image when it is being clicked to "zs.gif", "ws.gif", .... and again to "zs.gif"

But already in the first stage I get a newbie question - "How do I receive information about actual image?"

Function GUICtrlRead ( controlID ) doesn't bring information about imgae.

Below is code as for now:

GUISetState ()

While 1

$msg = GUIGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

Exit

Case $msg = $Image2

ChangeType($Image2)

EndSelect

WEnd

Func ChangeType($var)

$var = GUICtrlCreatePic("zs.gif", 65, 30, 35, 35)

EndFunc

Posted

how bout storing the existing picture in a variable?

like this

GUISetState ()
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
Case $msg = $Image2
ChangeType($Image2)
EndSelect
WEnd


Func ChangeType($var)
if $picture <> "zs.gif" then
$var = GUICtrlCreatePic("zs.gif", 65, 30, 35, 35)
$picture = "zs.gif"
else
$var = GUICtrlCreatePic("wv.gif", 65, 30, 35, 35)
$picture = "wv.gif"
endif

EndFunc

if your script is working this should do the job (haven't tried)

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...