I have begun windows programming and have just completed a functional calculator. I would like to take this calculator further by adding a "Fnc" or "function" button to the user controls which would allow you to view a new set of buttons, but still see the text box with the current entries. I am not sure of how I would complete this using Visual Studios Desktop Edition with Xaml and C#. Could I please get some help?
Asked
Active
Viewed 157 times
1 Answers
0
One possible way is by adding another <Grid>
-or any other container control you see it suitable: StackPanel
, WrapPanel
, DockPanel
, you name it- containing additional buttons. Then you can simply switch the <Grid>
's Visibility
between Visible
and Collapsed
upon "function" button clicked.

har07
- 88,338
- 12
- 84
- 137
-
If the buttons are not visible will they not be able to function? I guess what I am asking is that the hidden button will not receive a click too @har07 – Connor Oct 11 '14 at 04:50
-
Yes, hidden button can never receive a click. By using `Collapsed` (not `Hidden`), a control won't even take a space in the UI – har07 Oct 11 '14 at 05:05
-
What would the c# code be to cause the Visibility to become Collapsed @har07 – Connor Oct 12 '14 at 23:53
-
@user3806603 `myGrid.Visibility = Visibility.Collapsed;` – har07 Oct 13 '14 at 00:26
-
so you need the VISIBILITY.Collapsed? I kept trying to do myGrid.Visibility = Collapsed; – Connor Oct 13 '14 at 01:27
-
Yes, that's the correct syntax for [enum in C#](http://msdn.microsoft.com/en-us/library/sbbt4032.aspx) – har07 Oct 13 '14 at 01:53