Skip to main content
January 13, 2010
Question

Dynamically Hide/Show Controls??

  • January 13, 2010
  • 3 replies
  • 7716 views
Does anyone have a good way to get certain text boxes or list boxes to hide or show up based on a previous input? Basically, depending what the user selects in a listbox at the top, I need different input options to show up below.

I tried messing around with the "ForeColor" and "BackColor" commands to make everything white (and therefore sort of "hidden"), but I couldn't get it to work quite right.

Does anyone have a slick way of achieving this? By the way, I have Version 13, which I know is a crappy version, but there is not much I can do about that now.

Thanks!

3 replies

1-Visitor
January 13, 2010
" ...based on a previous input",
I don't digest that, don't see any use.

Put a Paint rectangle over the Mathcad region(s),
bring to front, send to back... so simple and quick.



jmG
January 13, 2010
Using a paint box might work....I'll give that a try.

What I meant by "...based on a previous input" is the following:

Imagine you have a listbox at the top of the sheet with the following items:

"Do Calculation Type #1"
"Do Calculation Type #2"
"Do Calculation Type #3"
"Do Calculation Type #4"

Each "Calculation Type" requires a different set of inputs and results in a different set of outputs. When the user selects a "Calculation Type", I want only the inputs and outputs related to that calc type to show up. I could have the inputs and outputs in four separate areas and then expand or collapse those areas depending on which calc type is being used, but I'm hoping to find a solution that is little more elegant and automated.

I will definitely give the paint box idea a try. Thanks for the suggestion!
23-Emerald V
January 13, 2010
On 1/13/2010 1:46:42 PM, jc_at_Aq wrote:
What I meant by "...based on a previous input" is the following:

Imagine you have a listbox at the top of the sheet with the following items:

"Do Calculation Type #1"
"Do Calculation Type #2"
"Do Calculation Type #3"
"Do Calculation Type #4"

Each "Calculation Type" requires a different set of inputs and results in a different set of outputs. When the user selects a "Calculation Type", I want only the inputs and outputs related to that calc type to show up.


Ah, when I first saw this I thought you were only intersted in a couple of regions, in which case playing around with the regions' xml contents might have been a possibility.

Would it be convenient to create 4 worksheets and then have another workheet call up the chosen one, as per the attached?

NOTE: the main worksheet attached to this message contains a VBScript component - you might need to change your Mathcad security settings to get it to run.

Stuart
24-Ruby IV
January 14, 2010
On 1/13/2010 12:54:54 PM, jc_at_Aq wrote:
>Does anyone have a good way to
>get certain text boxes or list
>boxes to hide or show up based
>on a previous input?
>Basically, depending what the
>user selects in a listbox at
>the top, I need different
>input options to show up
>below.
>
>I tried messing around with
>the "ForeColor" and
>"BackColor" commands to make
>everything white (and
>therefore sort of "hidden"),
>but I couldn't get it to work
>quite right.
>
>Does anyone have a slick way
>of achieving this? By the
>way, I have Version 13, which
>I know is a crappy version,
>but there is not much I can do
>about that now.
>
>Thanks!
One solution on the MAS:
http://twtmas.mpei.ac.ru/mas/Worksheets/Smart_Input.mcd
Val
http://twt.mpei.ac.ru/ochkov/v_ochkov.htm
January 14, 2010
Stuart, thanks for the suggestion, but I'd like to keep everything in one file. This sheet often gets used multiple times on the same project and it'd be cumbersome to have to save multiple uniquely-named files into the job folder each time we use the sheet.

jmG, I don't really get what that sheet is doing. I don't think it is functioning correctly since F(x)f on the Y-axis of the chart it red. How does this sheet relate to my question?

Val, could you attach an actual mathcad file? I can't see the scripting on the web-based version.

Everyone, Please take a look at the attached sheet to get an idea of what I'm trying to do. The method I'm using here is not perfect and I'm hoping someone out there will have a better way of doing it.

Thanks!

1-Visitor
January 14, 2010
On 1/14/2010 7:06:59 PM, jc_at_Aq wrote:
>jmG, I don't really get what
>that sheet is doing. I don't
>think it is functioning
>correctly since F(x)f on the
>Y-axis of the chart it red.
>How does this sheet relate to
>my question?
..............................
>Everyone, Please take a look
>at the attached sheet to get
>an idea of what I'm trying to do.

>...
>Thanks!
>________________________________

1. This work sheet does not hide/show. It selects a particular mhyper for the next part of the project, that can be lot more depending upon the function selected.
2. Change F(x)f for F(x)q in the plotting argument and change f for q in the vector. Only for the red curve we get a min and a max, just to show that project don't administrate as simply as it speaks !
3. No idea about what you want. You have no work sheet. Your attachment does not open in version 11. My example is just to show how to start to pilot a project and understand the difficulty depending upon to what it aims at. You wanted to hide/show a text box but now you want something totally different and not exemplified or for a limited audience (your version).

jmG



1-Visitor
January 14, 2010
On 1/13/2010 12:54:54 PM, jc_at_Aq wrote:
>Does anyone have a good way to
>... hide or show ... depending what the
>user selects...
>Thanks!
___________________________

In this wording: YES !
So much is done is so few steps in the attached.
Your project end use might not be a 1/1 similar application.
No red at all !

jmG