AndyS19 Posted August 6, 2017 Share Posted August 6, 2017 I created 3 radio buttons and when the script is run, the selected buttons display the text on the right of the actual button. Also, it appears like the radio button occupies space around it, as it obscures part of the other controls when I hover the mouse around it. I would like to group the buttons closer together and put other controls on the right of them. I also wanted to make the button text display on the left side of the button. Here is my test code: #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 Opt("GUICloseOnESC", 1) ; ESC closes GUI? (0 = no, 1 = yes) Opt("GUIOnEventMode", 1) ; Change to OnEvent mode Opt('MustDeclareVars', 1) OnAutoItExitRegister("ExitStageLeft") Opt("GUIEventOptions", 1) ;0=default, 1=just notification, 2=GuiCtrlRead tab index _Main() Func _Main() GUICreate("test", 300, 300, -1, -1, -1, -1) GUIStartGroup() local $x = 50, $y = 10, $w = 40, $h = 15,$spcY = 15 GUICtrlCreateRadio("", $x, $y, $w, $h) GUICtrlCreateRadio("ABC", $x, $y + ($spcY*1), $w, $h) GUICtrlCreateRadio("", $x, $y + ($spcY*2), $w, $h) GUIStartGroup() GUICtrlCreateInput("An Input Control", 70, 10, 110, 30) GUICtrlCreateInput("Another Input Control", 10, 73, 110, 20) GUISetOnEvent(-3, 'ExitStageLeft') GUISetState(@SW_SHOW) While (1) Sleep(251) WEnd EndFunc Func ExitStageLeft() Exit EndFunc I want "ABC" to display on the left of the 2nd radio button. Link to comment Share on other sites More sharing options...
Valuater Posted August 6, 2017 Share Posted August 6, 2017 Create the radio 20 x 20 ( maybe 15 x 15) and place a text line separately on the left 8) Link to comment Share on other sites More sharing options...
AndyS19 Posted August 6, 2017 Author Share Posted August 6, 2017 Great! That worked. my new code: expandcollapse popup#include <StaticConstants.au3> #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 Opt("GUICloseOnESC", 1) ; ESC closes GUI? (0 = no, 1 = yes) Opt("GUIOnEventMode", 1) ; Change to OnEvent mode Opt('MustDeclareVars', 1) OnAutoItExitRegister("ExitStageLeft") Opt("GUIEventOptions", 1) ;0=default, 1=just notification, 2=GuiCtrlRead tab index _Main() Func _Main() GUICreate("test", 300, 300, -1, -1, -1, -1) GUIStartGroup() Local $x = 50, $y = 10, $w = 20, $h = 18, $spcY = 15 GUICtrlCreateRadio("", $x, $y, $w, $h) GUICtrlCreateLabel("ABC", $x-40, $y + ($spcY * 1) + 3, 35, 20, $SS_RIGHT) GUICtrlCreateRadio("", $x, $y + ($spcY * 1), $w, $h) GUICtrlCreateRadio("", $x, $y + ($spcY * 2), $w, $h) GUIStartGroup() GUICtrlCreateInput("An Input Control", 70, 10, 110, 30) GUICtrlCreateInput("Another Input Control", 10, 73, 110, 20) GUISetOnEvent(-3, 'ExitStageLeft') GUISetState(@SW_SHOW) While (1) Sleep(251) WEnd EndFunc ;==>_Main Func ExitStageLeft() Exit EndFunc ;==>ExitStageLeft Valuater 1 Link to comment Share on other sites More sharing options...
Valuater Posted August 7, 2017 Share Posted August 7, 2017 The sleep is very large.. It is not required to be that high (251) Typically I use (10) 8) Link to comment Share on other sites More sharing options...
AndyS19 Posted August 7, 2017 Author Share Posted August 7, 2017 OK, thanks, I'll do that. It's always helpful when someone else looks at my code and suggests better ways of doing something. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now