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
 All Forums
 Origin Forum
 Origin Forum
 Drop-down menu in a worksheet

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
thomsen01 Posted - 03/20/2018 : 12:53:53 PM
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!!
1   L A T E S T    R E P L I E S    (Newest First)
Hideo Fujii Posted - 03/20/2018 : 2:40:47 PM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000