Sign in to follow this  
Followers 0
Mamba

GUICtrlCreatePic

8 posts in this topic

#1 ·  Posted (edited)

Question:

I want to make a pic-control to change image like a checkbox state, checked or unchecked. And i don't know how to see if the pic- control was "checked" or not.

Edited by Mamba

Share this post


Link to post
Share on other sites



It's a good question. I had the same Problem with a Icon in a button. Make behind the picture a button and disabled the pic

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

It's a good question. I had the same Problem with a Icon in a button. Make behind the picture a button and disabled the pic

I have a map, is a disabled Pic control. And i want to make such thing. If i click on the city for ex, a "check" image apears, if i click again, a transparent pic is laoded instead of "check" image. I've tried to do this with a button with bitmap loaded but didnt work.

Edited by Mamba

Share this post


Link to post
Share on other sites

OK. But I can't help you. I think you will one pic like a blue pic

Share this post


Link to post
Share on other sites

the same as you would if a button was pressed

Share this post


Link to post
Share on other sites

If works if for every pic i declare a boolean var to store the state. But if is there another way i want to know :P

Share this post


Link to post
Share on other sites

ummm could u provide ur script ahahha im to lazy to code something up at the moment :P

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

#include <GUIConstants.au3>
Opt("GuiOnEventMode", 1)
Global $gui, $button, $true

Main_Gui()

While 1
     Sleep (10)
WEnd

Func Main_Gui()
    
    $gui = GUICreate("Background", 820, 615)
    $combo = GUICtrlCreateCombo("", 675, 5, 130, 15, 0x0003)
    GUICtrlSetData($combo, "Регион 3|Регион 4|Регион 5|Регион 6|Регион 7|Регион 8|Регион 9|Регион 12", "Регион 8")
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
    GUISetState()


    $hGUI = GUICreate("", 665, 615, -1, -1, BitOR($WS_POPUP, $WS_VSCROLL, $WS_HSCROLL), BitOr($WS_EX_LAYERED,$WS_EX_MDICHILD),$gui)

   $map = GUICtrlCreatePic(@ScriptDir & "\8\region8_2.jpg", 80, 0, 0, 0)
   ;507x607
    GuiCtrlSetState($map,$GUI_DISABLE)

    $button = GUICtrlCreatePic("none.jpg", 50, 50, 0, 0)
    GUICtrlSetOnEvent($button, "_Select")
    $true = False

    GUISetState()

EndFunc

Func _Select()
    
    If $true Then
        GUICtrlSetImage($button, "none.jpg")
    Else
        GUICtrlSetImage($button, "selected.jpg")
    EndIf
    
    $true = Not $true
    
EndFunc

Func _Exit()
    Exit 0
EndFunc

Edited by Mamba

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  
Followers 0