How can disable the controls from code

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
AlessioForconi
Posts: 90
Joined: Sun Feb 15, 2015 2:51 pm

How can disable the controls from code

Post by AlessioForconi » Mon Feb 16, 2015 11:25 am

Hi to all

how can I disable one or more controls from code? It's need to do it one by one?

Thank You

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: How can disable the controls from code

Post by LCNeil » Mon Feb 16, 2015 11:30 am

Hi Alessio,

You should be able to disable controls via its disable property.

e.g. for a button

Code: Select all

set the disabled of button 1 to true
Kind Regards,

Neil Roger
--
LiveCode Support Team ~ http://www.livecode.com
-

AlessioForconi
Posts: 90
Joined: Sun Feb 15, 2015 2:51 pm

Re: How can disable the controls from code

Post by AlessioForconi » Mon Feb 16, 2015 11:50 am

Hi Neil
LCNeil wrote:Hi Alessio,

You should be able to disable controls via its disable property.

e.g. for a button

Code: Select all

set the disabled of button 1 to true
Having more controls to disable or enable you necessarily have to do one by one or you can group them?

Thank you

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: How can disable the controls from code

Post by jmburnod » Mon Feb 16, 2015 12:02 pm

Hi Alessio,
Having more controls to disable or enable you necessarily have to do one by one or you can group them?
You can disable all controls of a group like that:

Code: Select all

set the disabled of group "mygroup" to true
Best regards
Jean-Marc
https://alternatic.ch

AlessioForconi
Posts: 90
Joined: Sun Feb 15, 2015 2:51 pm

Re: How can disable the controls from code

Post by AlessioForconi » Mon Feb 16, 2015 12:08 pm

jmburnod wrote:Hi Alessio,
Having more controls to disable or enable you necessarily have to do one by one or you can group them?
You can disable all controls of a group like that:

Code: Select all

set the disabled of group "mygroup" to true
Best regards
Jean-Marc
Forgive me my many questions but are an absolute beginner.
How do I group the controls?

Thanks

AlessioForconi
Posts: 90
Joined: Sun Feb 15, 2015 2:51 pm

Re: How can disable the controls from code

Post by AlessioForconi » Mon Feb 16, 2015 12:35 pm

jmburnod wrote:Hi Alessio,
Having more controls to disable or enable you necessarily have to do one by one or you can group them?
You can disable all controls of a group like that:

Code: Select all

set the disabled of group "mygroup" to true
Best regards
Jean-Marc
Forgive me my many questions but are an absolute beginner.
How do I group the controls?

Thanks

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: How can disable the controls from code

Post by jmburnod » Mon Feb 16, 2015 12:54 pm

Hi Alessio,
Forgive me my many questions but are an absolute beginner.
Please no apologise, this beginner forum is made for that.
To group several controls
1. Select the control you want in your group
2. Click on btn group of the toolbar
3. Group is made :D
For details have a look at "group" in the LC dictionary
Best regards
Jean-Marc
https://alternatic.ch

AlessioForconi
Posts: 90
Joined: Sun Feb 15, 2015 2:51 pm

Re: How can disable the controls from code

Post by AlessioForconi » Mon Feb 16, 2015 2:47 pm

It's really simple :lol:

Thanks :)

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: How can disable the controls from code

Post by Klaus » Mon Feb 16, 2015 2:52 pm

Buongiorno Alesio,

you might be intereted in taking a look at these great stacks to get the basics of LC:
http://www.hyperactivesw.com/revscriptc ... ences.html

Best

Klaus

Post Reply