Sign in to follow this  
Followers 0
Damein

GuiCtrlCreateButton + Img = Not clickable?

3 posts in this topic

#1 ·  Posted (edited)

For some reason I can't get this to work.

Func _Floor1()
    GuiCtrlSetState($Floor1Image, $GUI_SHOW)
    For $i = 1 To 8
            $RoomStatus[$i] = IniRead(@ScriptDir & "\Data\Floor1Rooms.ini", $i, "Status", "Not Found")
            $RoomImage[$i] = @ScriptDir & "\Images\" & $RoomStatus[$i] & ".bmp"
            $X = IniRead(@ScriptDir & "\Data\Floor1Rooms.ini", $i, "X", "Not Found")
            $Y = IniRead(@ScriptDir & "\Data\Floor1Rooms.ini", $i, "Y", "Not Found")
            GuiCtrlCreatePic($RoomImage[$i],$X,$Y,65,65)
            GuiCtrlSetState(-1, $GUI_SHOW)
            $CheckMaintenance = IniRead(@ScriptDir & "\Data\Floor1Rooms.ini", $i, "Maintenance", "Not Found")
            If $CheckMaintenance = 1 Then
                $MaintenanceButtonIssue[$i] = GuiCtrlCreateButton("Test",$X+12, $Y+12,40,40,$BS_BITMAP)
                GUICtrlSetImage(-1, $MaintenanceImage)
                GUICtrlSetOnEvent($MaintenanceButtonIssue[$i], "_Test")
            EndIf
Next
EndFunc

All images show, and all buttons show. But I cannot click the button.

If more information is needed I can provide the entire program with images, but I feel like I must just be missing something.

Thanks.

Edited by Damein

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

Share this post


Link to post
Share on other sites



Oh, I think I found the fix.

I had to add

GuiCtrlSetState($MaintenanceButtonIssue[$i], $GUI_ONTOP)

I've never used that before, but I assume from the name it means that the button is being created underneath the other images and thus can't be clicked?

If there is a nicer way to doing this, I'll take it. But I'll update it with this for the moment.

Thanks.


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

Share this post


Link to post
Share on other sites

This is probably a preferred way to handle it.

 

GuiCtrlCreatePic($RoomImage[$i],$X,$Y,65,65)

GuiCtrlSetState(-1, $GUI_DISABLE)

8)


NEWHeader1.png

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