I want to be able to make a program. It's a program for a pizza from. I have two buttons on the side (Pizza and subs) When I click the pizza button, i want it to show the rest of the buttons to add a small pizza,medium pizza and large pizza. If i click the subs button however the pizza buttons go away and instead the subs button appear to add subs.. etc
Is there any way to do that?
You can set NameOfControl. visible = false on any controls you want to disappear.
Click View > View Textboxes. The two textboxes you added should disappear. To hide a control, simply set it's Visible property to False.
To disable a button in Blazor after it is clicked, set the disabled property to true for the button element by binding the property. In the sample, the disabled property of a button element is set to true on button click.
To answer your question as asked, you should put all the controls for Pizza in to one GroupBox and the controls for Subs in to another GroupBox. Place both GroupBoxes at the same location and then on the click of the radio button, make one visible and the other not visible.
That said, you should consider the user experience. More intuitive than a form changing based on radio buttons (and even easier to code) would be a TabControl with tabs of "Pizza" and "Subs".
TabControl: http://msdn.microsoft.com/en-us/library/system.windows.forms.tabcontrol.aspx
Yes...
Handle the Click
event and, in the handler, set the Visible
property of your buttons/UserControl/whatever.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With