Jump to content
Sign in to follow this  
5t0n3r

Overlapping Input and Button

Recommended Posts

5t0n3r

I am having an issue where the button and input box seem to be overlapping.

When you go to click on the button, you have to click on the bottom part of it for it to work.

If it is moved to a different part of the screen where there isn't any other inputs, it works fine.

Is there any way around it?

#include <GUIConstants.au3>

GUICreate("Test Radio Buttons",400,430,-1,-1)

Dim $new1Input1, $new1Input2

GUICtrlCreateLabel ("Selection?",10,10,350,20)
GUICtrlSetFont (-1,10)
GUICtrlCreateGroup ("", 10, 30, 140, 60)
$new1Radio1 = GUICtrlCreateRadio ("YES", 30, 50, 50, 20)
$new1Radio2 = GUICtrlCreateRadio ("NO", 80, 50, 50, 20)
$new1Label1 = GUICtrlCreateLabel ("label 1",  10,110,350,20)
GUICtrlSetState(-1, $GUI_HIDE)
GUICtrlSetFont (-1,10)
$new1Input1 = GUICtrlCreateInput ( "label 1", 30, 140, 200, 20 )
GUICtrlSetState(-1, $GUI_HIDE)
$new1Label2 = GUICtrlCreateLabel ("label 2",  10,110,350,40)
GUICtrlSetState(-1, $GUI_HIDE)
GUICtrlSetFont (-1,10)
$new1Input2 = GUICtrlCreateButton ("label 2", 30, 140, 200, 20 )
GUICtrlSetState(-1, $GUI_HIDE)

GUISetState()

While 1
    $page1Msg1 = GUIGetMsg()
    If $page1Msg1 = $new1Radio1 Then
        GUICTRLSetState($new1Label1, $GUI_SHOW)
        GUIctrlSetState($new1Input1, $GUI_SHOW)
        GUIctrlSetState($new1Label2, $GUI_HIDE)
        GUIctrlSetState($new1Input2, $GUI_HIDE)
    EndIf
    If $page1Msg1 = $new1Radio2 Then
        GUIctrlSetState($new1Label1, $GUI_HIDE)
        GUIctrlSetState($new1Input1, $GUI_HIDE)
        GUIctrlSetState($new1Label2, $GUI_SHOW)
        GUIctrlSetState($new1Input2, $GUI_SHOW)
        EndIf
    If $page1Msg1 = $GUI_EVENT_CLOSE Then ExitLoop
Wend

Share this post


Link to post
Share on other sites
somdcomputerguy

I think you have answered your own question..


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites
5t0n3r

True, it is a workaround. But I am hoping to re-use the area, so I need to be able to have multiple things show up without interference.

This is part of a larger project and the area for input will be limited. Hence the need to re-use the same area over and over.

Hopefully this can be done.

Share this post


Link to post
Share on other sites
ctyankeeinok

Your problem is that the "label 2" label is overlapping the button space. It has nothing to do with the label1 entry field. your label2 label starts at 110 (top), has a width of 350 and a height of 40, which takes it down to 150 - over and across the button area. The button has a top of 140, which is a 10 pixel overlap. Fix the height on the "label 2" label to 20 and it works correctly.

Share this post


Link to post
Share on other sites
5t0n3r

That's great, thank you very much. I was hoping it was something I missed.

I'm not too proud to admit that... but if you repeat it to anyone I'll deny it. LOL :D

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.