The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Drop-down menu in a worksheet
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

thomsen01

Austria
22 Posts

Posted - 03/20/2018 :  12:53:53 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 2016G (64bit) Sr2; Windows 7

Hi,

is there a simple way to create a drop-down menu in a worksheet (or similar)? I would like to have a drop-down list where the user can choose from 4 or 5 options. Depending on the selection, a value should be displayed in the field next to it (or similar), so that I can make further calculations with this value.

Thanks!!

Hideo Fujii

USA
1582 Posts

Posted - 03/20/2018 :  2:40:47 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi thomsen01,

Maybe you are thinking of like a drop-down setting at a cell in a spreadsheet. Although there is no exactly
the same mechanism currently in Origin, but you can mimic it by the label button which triggers a script,
which contains a GetN command to open a selection dialog box.
(See https://www.originlab.com/doc/LabTalk/ref/getnumber-cmd )
For example, see the sample below:



Here, you can select a cell in a worksheet, press "My Choice of Color" button. Then, the drop-down
dialog appears, and when you click OK, the selected color is entered to the current cell.
The script behind the button is the following simple 4-line code:
range rcol=wcol(selc1);              //Current column of the cell
string colorlist$="Red Green Blue Purple";  //List of choices
getN (My favorite color is:) ii:colorlist$;  //Open the dialog box
rcol[selr1]$=token(colorlist$,ii)$;  //Assign the value to the cell
You set this script as to be triggered by "Button Up" in the Text Object dialog. See the details at:
https://www.originlab.com/doc/LabTalk/guide/From-Graphical-objs

Hope this helps.

--Hideo Fujii
OriginLab

Edited by - Hideo Fujii on 03/20/2018 2:47:37 PM
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000