cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Dynamically Hide/Show Controls??

jc_at_Aq-disabl
1-Visitor

Dynamically Hide/Show Controls??

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!
17 REPLIES 17

" ...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

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!

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

On 1/13/2010 1:46:42 PM, jc_at_Aq wrote:
>Using a paint box might work.
______________________________

The Paint box only hides/shows as per your original request. Now you want to hide/show and activate only the activated (shown) regions. Maybe you just have activate the corresponding function for a single functional resulting block. The best is to attach your work sheet in your actual version, just also in case the work is micmac. The DAEP "Filter window" is a good example (Xavier).

jmG

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



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

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!

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



On 1/14/2010 7:06:59 PM, jc_at_Aq wrote:

>Val, could you attach an
>actual mathcad file? I can't
>see the scripting on the
>web-based version.
See the attached file!
Val
http://twt.mpei.ac.ru/ochkov/v_ochkov.htm

I apologize. I did not mean to discriminate against any of my 'audience' with the version of the file I posted. I have back-saved it as a MathCad 2001i file, so nobody should feel left out now.

Additionally, I'm sorry if you have misinterpreted what I wrote, but I have not changed what I am asking for. I'm sorry that I do not see how that file jmG posted is related to this post. Perhaps someone smarter than me can explain how it is related. I only have three engineering degrees - apparently that does not qualify me to participate in this forum.

I'd appreciate it if some other folks could take a look at the attached file and see if they can come up with a cleaner way of accomplishing what I'm trying to do. Basically, the only thing I'm hung up on is making the outline of the textbox go away when it is supposed to be hidden. If the textbox was a MathCad textbox, I could just un-check the "client edge" option, but I am using MS Form 2.0 text boxes (for reason explained in the file) and I do not know the command to hide the border of a MS Form 2.0 text box....

On 1/15/2010 12:48:33 PM, jc_at_Aq wrote:
>... I'm sorry that I do not see how that
>file jmG posted is related to this post.
___________________________

How can anyone understand what you don't describe ?

What do you want in there ?
"This is a very simple example of what I'm trying to do. The real sheet I am working on is obviously much more complex.

When you select one of the options from the list box, the relevant Input and Output options either show up or hide down below the list box. There are a couple of things wrong with the method I am using. First, I have to use MS Form 2.0 boxes because Mathcad boxes do not print their formatting correctly. Second, the outline of the text box can still be seen even though it should be "hidden". Does anyone have a better way to achieve the same thing ? "

The list box has no built-in "bring to front send to back" over itself. Don't you think you must have two objects in cause like the Paint proposal. The way you speak, it seems that once you have selected from the list box you want it hides by itself, then how would you revive for the next selection ? Another feature ? Mathcad is not an "hide & seek" game toy.

Make yourself clear and smarter collabs than me will help. Maybe that scripted component can be made blank in such a way that if you hover the pointer in that region, then click to see it again and go to next selection and blank again ... is that what you mean ?

like this:
select and blank on leave
hover and see it again
and what about the displays ? another "hide & seek" ?

jmG

You can make it work if you pay with some other properties. I only changed one of the text boxes (sorry - too lazy to do the others!).

Richard

Ha! Perfect. I knew it was something that simple, I just didn't know the proper commands. I've been reading through the MS Forms 2.0 help file, but couldn't find the specific combination of properties that I needed.

Thank you very much!

On 1/15/2010 1:23:35 PM, jc_at_Aq wrote:
>Ha! Perfect. ...
>Thank you very much !
_____________________

Then not the list box itself as you said, but the list box result. Maybe your next demand will be to show the real parameter name instead of "Input".




jmG, Glad to see the New Year has not changed you.
Cheers

On 1/15/2010 5:23:43 PM, ElSid wrote:
>jmG, Glad to see the New Year
>has not changed you.
>Cheers
_____________________

It made even worse because in the switch of the year I forgot how to get the diagonal of an egg, unless you make it cube. Questions should allow a diagram or an equation, or respond like a bank account #. BTW, you have never responded about the noise attenuation that toke so long to figure from a simple equation that toke you several dozen demand and that would have taken a pair of exchanged communication.

Got side tracked with noise attenuation. Need to finish new "hot Potato" project first. Will repost on that thread as soon as I get a chance. Attenuation problem is a personal project 🙂
Announcements

Top Tags