Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Enable/Disable Radio and checkboxes


  • Please log in to reply
4 replies to this topic
ThorIII
  • Members
  • 7 posts
  • Last active: Jan 31 2014 08:21 AM
  • Joined: 13 Mar 2013
#SingleInstance force   
Gui, Show, x127 y87 h300 w640, ...::: Test  :::...

Gui, Add, GroupBox, 	x22 		y40 		w110 	h190 					, Group1
Gui, Add, Radio, 			x32 		y60 		w90 		h20 	vRadio1		, RadioText1
Gui, Add, Radio, 			x32 		y80 		w90 		h20 	vRadio2		, RadioText2

Gui, Add, GroupBox, 	x142 	y40 		w110 	h190 					, Group2
Gui, Add, CheckBox, 	x152 	y60 		w90 		h20 	vCheck1		, CheckText1
Gui, Add, CheckBox, 	x152 	y80 		w90 		h20  vCheck2		, CheckText2
Gui, Add, CheckBox, 	x152 	y100 	w90 		h20	vCheck3		, CheckText3
Gui, Add, CheckBox, 	x152 	y120 	w90 		h20	vCheck4		, CheckText4
Gui, Add, CheckBox, 	x152 	y140 	w90 		h20	vCheck5		, CheckText5
Gui, Add, CheckBox, 	x152 	y160 	w90 		h20	vCheck6		, CheckText6
Gui, Add, CheckBox, 	x152 	y180 	w90 		h20	vCheck7		, CheckText7
Gui, Add, CheckBox, 	x152 	y200 	w90 		h20 	vCheck8		, CheckText8

Gui, Add, GroupBox, 	x262 	y40 		w110 	h190 					, Group3
Gui, Add, Radio, 			x272 	y60 		w90 		h20 	vRadio3		, RadioText3
Gui, Add, Radio, 			x272 	y80 		w90 		h20 	vRadio4		, RadioText4
Gui, Add, Radio, 			x272  	y100 	w90 		h20 	vRadio5		, RadioText5
Gui, Add, Radio, 			x272  	y120 	w90 		h20 	vRadio6		, RadioText6

Gui, Add, GroupBox, 	x382 	y40 		w110 	h190 					, Group4
Gui, Add, Radio, 			x392 	y60 		w90 		h20 	vRadio7		, RadioText7
Gui, Add, Radio, 			x392 	y80 		w90 		h20 	vRadio8		, RadioText8
Gui, Add, Radio, 			x392 	y100 	w90 		h20 	vRadio9		, RadioText9
Gui, Add, Radio, 			x392 	y120 	w90 		h20 	vRadio10		, RadioText10
Gui, Add, Radio, 			x392 	y140 	w90 		h20 	vRadio11		, RadioText11
Gui, Add, Radio, 			x392 	y160 	w90 		h20 	vRadio12		, RadioText12

Gui, Add, GroupBox, 	x502 	y40 		w110 	h190 					, Group5
Gui, Add, Radio, 			x512 	y60 		w90 		h20 	vRadio13		, RadioText13
Gui, Add, Radio, 			x512 	y80 		w90 		h20 	vRadio14		, RadioText14
Gui, Add, Radio, 			x512 	y100 	w90 		h20 	vRadio15		, RadioText15
Gui, Add, Radio, 			x512 	y120 	w90 		h20 	vRadio16		, RadioText16
Gui, Add, Radio, 			x512 	y140 	w90 		h20 	vRadio17		, RadioText17
gui, show
return

GuiClose:
ExitApp

Hi, question from newbie.

 

Can someone help me with this. If you Select one of the radio buttons in Group1, some of the checkboxes in Group2 will be disabled. If you Select one radio in Group3 some of the radios in Group4 will be disabled. How can this be done. I've been browsing the forum and forum and found some examples but did not manage to make it work. please help!

 



Morpheus
  • Members
  • 475 posts
  • Last active: Oct 21 2014 11:08 AM
  • Joined: 31 Jul 2008

You would need to use a Glabel, and GuiControl
 

G: Gosub (g-label). Launches a subroutine automatically when the user clicks or changes a control. Immediately after the letter G, specify the name of the label to execute. gCancel may be specified to perform an implicit Gui Cancel (but if a label named "Cancel" exists in the script, it will be executed instead). The subroutine may consult the following built-in variables: A_Gui, A_GuiControl, A_GuiEvent, and A_EventInfo.

Any code that I post will be for AHK Basic.
I'm not always right, but I still try to help.

ThorIII
  • Members
  • 7 posts
  • Last active: Jan 31 2014 08:21 AM
  • Joined: 13 Mar 2013
Please, please make an example......

Morpheus
  • Members
  • 475 posts
  • Last active: Oct 21 2014 11:08 AM
  • Joined: 31 Jul 2008

Sure, No problem.
 

#SingleInstance force
Gui, Show, x127 y87 h300 w640, ...::: Test  :::...

Gui, Add, GroupBox, 	x22 		y40 		w110 	h190 					, Group1
Gui, Add, Radio, 			x32 		y60 		w90 		h20 	vRadio1		gSub1, RadioText1
Gui, Add, Radio, 			x32 		y80 		w90 		h20 	vRadio2		gSub1, RadioText2

Gui, Add, GroupBox, 	x142 	y40 		w110 	h190 					, Group2
Gui, Add, CheckBox, 	x152 	y60 		w90 		h20 	vCheck1		, CheckText1
Gui, Add, CheckBox, 	x152 	y80 		w90 		h20  vCheck2		, CheckText2
Gui, Add, CheckBox, 	x152 	y100 	w90 		h20	vCheck3		, CheckText3
Gui, Add, CheckBox, 	x152 	y120 	w90 		h20	vCheck4		, CheckText4
Gui, Add, CheckBox, 	x152 	y140 	w90 		h20	vCheck5		, CheckText5
Gui, Add, CheckBox, 	x152 	y160 	w90 		h20	vCheck6		, CheckText6
Gui, Add, CheckBox, 	x152 	y180 	w90 		h20	vCheck7		, CheckText7
Gui, Add, CheckBox, 	x152 	y200 	w90 		h20 	vCheck8		, CheckText8

Gui, Add, GroupBox, 	x262 	y40 		w110 	h190 					, Group3
Gui, Add, Radio, 			x272 	y60 		w90 		h20 	vRadio3		, RadioText3
Gui, Add, Radio, 			x272 	y80 		w90 		h20 	vRadio4		, RadioText4
Gui, Add, Radio, 			x272  	y100 	w90 		h20 	vRadio5		, RadioText5
Gui, Add, Radio, 			x272  	y120 	w90 		h20 	vRadio6		, RadioText6

Gui, Add, GroupBox, 	x382 	y40 		w110 	h190 					, Group4
Gui, Add, Radio, 			x392 	y60 		w90 		h20 	vRadio7		, RadioText7
Gui, Add, Radio, 			x392 	y80 		w90 		h20 	vRadio8		, RadioText8
Gui, Add, Radio, 			x392 	y100 	w90 		h20 	vRadio9		, RadioText9
Gui, Add, Radio, 			x392 	y120 	w90 		h20 	vRadio10		, RadioText10
Gui, Add, Radio, 			x392 	y140 	w90 		h20 	vRadio11		, RadioText11
Gui, Add, Radio, 			x392 	y160 	w90 		h20 	vRadio12		, RadioText12

Gui, Add, GroupBox, 	x502 	y40 		w110 	h190 					, Group5
Gui, Add, Radio, 			x512 	y60 		w90 		h20 	vRadio13		, RadioText13
Gui, Add, Radio, 			x512 	y80 		w90 		h20 	vRadio14		, RadioText14
Gui, Add, Radio, 			x512 	y100 	w90 		h20 	vRadio15		, RadioText15
Gui, Add, Radio, 			x512 	y120 	w90 		h20 	vRadio16		, RadioText16
Gui, Add, Radio, 			x512 	y140 	w90 		h20 	vRadio17		, RadioText17
gui, show
return

Sub1:
GuiControlGet, Radio1
If Radio1 = 1
 GuiControl, Disable, Check1
Else GuiControl, Enable, Check1
Return

GuiClose:
ExitApp

Any code that I post will be for AHK Basic.
I'm not always right, but I still try to help.

ThorIII
  • Members
  • 7 posts
  • Last active: Jan 31 2014 08:21 AM
  • Joined: 13 Mar 2013

Manny thanks Morpheus,

I really appreciate this. Thanks!