Sign in to follow this  
Followers 0
cad29

GUI HELP cant click the button

6 posts in this topic

Hi i need help with my script the problem of my script is the button is not clickable anymore once you insert the Label in the script then thats the time you are able to click any one of the option please help thanks a lot

HERES MY SCRIPT

#include <GUIConstants.au3>

GUICreate("Select Option",350,150,398,100,BitOR($WS_SYSMENU,$WS_MINIMIZEBOX));$WS_SYSMENU)

$labelR = GUICtrlCreateLabel ("Please Select the following and click it ?", 41,10,350,150)

GUICtrlSetColor(-1,0xFF0000)

GUICtrlSetFont (-1,10, 800)

GUICtrlSetColor(-1, 0x008CF5) ; sets the color of the letters

GUISetFont (10, 400, 4, "Courier New Bold Italic")

GUISetBkColor(0x000064) ; sets the bkgrnd color of the window

;GUICtrlCreateButton ( "text", left, top [, width [, height [, style [, exStyle]]]] )

$OPTION1 = GUICtrlCreateButton ("THIS IS OPTION # 1", 25, 30, 300,25)

$OPTION2 = GUICtrlCreateButton ( "THIS IS OPTION # 2", 25, 60,300,25)

$OPTION3 = GUICtrlCreateButton ("THIS IS OPTION #3" , 25, 90,300,25)

GUISetState ()

While 1

$msg = GUIGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

Case $msg = $OPTION1

msgbox(0,"Option Selected","You select option #1")

ExitLoop

Case $msg = $OPTION2

msgbox(0,"Option Selected","You select option #2")

ExitLoop

Case $msg = $OPTION3

msgbox(0,"Option Selected","You select option #3")

ExitLoop

EndSelect

WEnd

Share this post


Link to post
Share on other sites



You placed a long-fingered button-butt-loving label behind the buttons. This should fix it :

GUICtrlSetState($labelR, $GUI_DISABLE)

Share this post


Link to post
Share on other sites

Look at the height of your label... it underlaps the controls, so if your focus is on the label, then the buttons are not able to be clicked:

#include <GUIConstants.au3>
GUICreate("Select Option", 350, 150, 398, 100, BitOR($WS_SYSMENU, $WS_MINIMIZEBOX));$WS_SYSMENU)
$labelR = GUICtrlCreateLabel("Please Select the following and click it ?", 41, 10, 350, 20)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetFont(-1, 10, 800)
GUICtrlSetColor(-1, 0x008CF5) ; sets the color of the letters
GUISetFont(10, 400, 4, "Courier New Bold Italic")
GUISetBkColor(0x000064) ; sets the bkgrnd color of the window
;GUICtrlCreateButton ( "text", left, top [, width [, height [, style [, exStyle]]]] )
$OPTION1 = GUICtrlCreateButton("THIS IS OPTION # 1", 25, 30, 300, 25)
$OPTION2 = GUICtrlCreateButton("THIS IS OPTION # 2", 25, 60, 300, 25)
$OPTION3 = GUICtrlCreateButton("THIS IS OPTION #3", 25, 90, 300, 25)
GUISetState()
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $OPTION1
            MsgBox(0, "Option Selected", "You select option #1")
            ExitLoop
        Case $msg = $OPTION2
            MsgBox(0, "Option Selected", "You select option #2")
            ExitLoop
        Case $msg = $OPTION3
            MsgBox(0, "Option Selected", "You select option #3")
            ExitLoop
    EndSelect
WEnd


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Hi Helge your great it work thanks a lot for your help

Share this post


Link to post
Share on other sites

long-fingered button-butt-loving label

underlaps the controls

I can see i am still learning a new language here at Autoit

lol

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Hi Helge your great it work thanks a lot for your help

His might work, but it's not the root of the issue, and people like me that have skinned themes on their windows, it comes out really bad when it's disabled with all the font settings.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

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