Combobox to First State

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
ARAS
Posts: 55
Joined: Sat Nov 02, 2013 5:35 pm

Combobox to First State

Post by ARAS » Sun Dec 08, 2013 6:33 pm

Hello,

I have three comboboxes(option type buttons). They are called cDay, cMonth, cYear.

They are basically for Day, Month and Year. I want to reset those comboboxes after I click a button.

Let's say I chose 5 June 1945 and I clicked a button called "Submit".

I want to the comboboxes to return their original state - 1 January 1940 or Day Month Year.

It will show the first value in the content or Day Month Year. In a nutshell, I am trying to clear the combobox for the next submission.

I would appreciate if sb could help me.

Regards,
ARAS

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

Re: Combobox to First State

Post by Klaus » Sun Dec 08, 2013 6:48 pm

Hi Aras,

LABEL is what you want to set:
---
set the label of btn "your btn here..." to line 1 of the text of btn "your btn here..."
...


Best

Klaus

ARAS
Posts: 55
Joined: Sat Nov 02, 2013 5:35 pm

Re: Combobox to First State

Post by ARAS » Sun Dec 08, 2013 6:58 pm

Hi Klaus,

It works.

Thank you,
ARAS

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: Combobox to First State

Post by dunbarx » Sun Dec 08, 2013 7:19 pm

What Klaus said.

I always see it better when I set or read the menuHistory:

set the menuHistory of btn "yourCombo" to 1

Makes me pay attention to the actual line number shown. Also, you do not need to know what the text in line 1 actually is:

repeat with y = 1 to the number of btnsThatAreCombos
set the menuHistory of btn y to 1
end repeat

Craig Newman

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

Re: Combobox to First State

Post by Klaus » Sun Dec 08, 2013 7:25 pm

Hi Craig,

yes, but just setting the label does not fire a "menupick" message like setting the menuhistory does! 8)


Best

Klaus

Post Reply