Jump to content

Recommended Posts

Posted

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
Posted

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.

Posted

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.

Posted

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...