Sign in to follow this  
Followers 0
=sinister=

Creating a Pic OnTop

3 posts in this topic

So when I create a picture within another picture, it always seems under the first one made.

Example:

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Form1", 288, 225, 193, 125)
$Pic1 = GUICtrlCreatePic("images\Marker.gif", 80, 96, 100, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Button1 = GUICtrlCreateButton("Button1", 176, 32, 75, 25, 0)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            $Pic2 = GUICtrlCreatePic("images\Fretboard_03.gif", 64, 72, 60, 60, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
            
    EndSwitch
WEnd

$Pic2 is under $Pic1. Is there any way to make it so $Pic2 is above $Pic1?

Share this post


Link to post
Share on other sites



#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Form1", 288, 225, 193, 125)
$Pic1 = GUICtrlCreatePic("images\Marker.gif", 80, 96, 100, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Button1 = GUICtrlCreateButton("Button1", 176, 32, 75, 25, 0)
$Button2 = GUICtrlCreateButton("Button2", 176, 57, 75, 25, 0)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            $Pic2 = GUICtrlCreatePic("images\Fretboard_03.gif", 64, 72, 60, 60, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
            GUICtrlSetState(-1, $GUI_ONTOP)
        Case $Button2
            $Pic3 = GUICtrlCreatePic("images\Marker.gif", 42, 50, 60, 60, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
            GUICtrlSetState(-1, $GUI_ONTOP)
            
    EndSwitch
WEnd

I believe there are better ways to do that.

Share this post


Link to post
Share on other sites

WoW I didn't really think that through. Well after 2 1/2 hours and 829 lines of completely bug free code (Well as of now haha), i'm tired ><

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