I finally used ohter methods that are easier but less adjustable
1) wrap the elements in a grid
2) use a foreach( control texb in ...)
Thanks
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi, I have many textbox that I want to control (change visibility) programmaticaly.
But I can not find a good way to do it.
So for now my cs contains this outrageous code:
lab_code.Visibility = Visibility.Visible;
lab_destinataire.Visibility = Visibility.Visible;
Form_code.Visibility = Visibility.Visible;
Form_destinataire.Visibility = Visibility.Visible;
Titre_clients.Visibility = Visibility.Visible;
lab_traffic.Visibility = Visibility.Visible;
Form_trafic.Visibility = Visibility.Visible;
Form_bgpcli.Visibility = Visibility.Visible;
lab_plat.Visibility = Visibility.Collapsed;
Form_plateforme.Visibility = Visibility.Collapsed;
I'd like to put them together (like giving the same css class name) then change their property pls
I finally used ohter methods that are easier but less adjustable
1) wrap the elements in a grid
2) use a foreach( control texb in ...)
Thanks
Hi,@Butachan .Welcome Microsoft Q&A.
You could bind the first 8 text boxes to property MyVisibility
and the last two text boxes to property MyVisibility1
. Here is sample code
complete code:
The result:
designer screenshot.
screenshot of initial value.
Screenshot of the modified value.
----------------------------------------------------------------------------
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.