Descativer un datepicker en fonction d'un bouttin radio

Résolu/Fermé
mimi19911980 Messages postés 22 Date d'inscription mardi 10 novembre 2020 Statut Membre Dernière intervention 14 octobre 2021 - Modifié le 13 août 2021 à 20:41
Whismeril Messages postés 19025 Date d'inscription mardi 11 mars 2003 Statut Contributeur Dernière intervention 19 avril 2024 - 14 août 2021 à 07:40
Bonjour j'ai un boutton radio et un datePeaker je veux quand je clique sur le boutton radio (non) le datePicker doit être désactiver
comment le faire svp

voici le code xaml :

         <Label Content="Chirugie Programmé" HorizontalAlignment="Left" Height="55" Margin="161,96,0,0" VerticalAlignment="Top" Width="184" Foreground="#FFE63070" FontFamily="High Tower Text" FontWeight="Bold" FontStyle="Italic" FontSize="20"/>

        <RadioButton x:Name="ouichirugie" GroupName="chirugie" Content="Oui" HorizontalAlignment="Left" Height="60" Margin="347,81,0,0" VerticalAlignment="Top" Width="71" FontFamily="High Tower Text" FontSize="20" FontWeight="Bold" FontStyle="Italic"  />

        <RadioButton x:Name="nonchurigie" GroupName="chirugie" Content="Non" HorizontalAlignment="Left" Height="61" Margin="425,79,0,0" VerticalAlignment="Top" Width="104" FontSize="20"  FontFamily="High Tower Text"  FontWeight="Bold" FontStyle="Italic" Checked="nonchurigie_Checked_1"      />


        <Label Content="Date Chirugie" HorizontalAlignment="Left" Height="55" Margin="155,184,0,0" VerticalAlignment="Top" Width="139" Foreground="#FFE63070" FontFamily="High Tower Text" FontWeight="Bold" FontStyle="Italic" FontSize="20"/>

        <DatePicker x:Name="id_dateAdmission" HorizontalAlignment="Left" Height="24" Margin="345,136,0,0" VerticalAlignment="Top" Width="493"/>




quelqu'un peut m'aider?
Merci beaucoup.
A voir également:

2 réponses

Whismeril Messages postés 19025 Date d'inscription mardi 11 mars 2003 Statut Contributeur Dernière intervention 19 avril 2024 928
13 août 2021 à 22:39
Bonsoir

tu peux binder la propriété IsEnabled du datetimepicker à la propriété IsChecked du radiobutton, pour cibler le radiobutton dans le binding du dois renseigner ElementName.



0
mimi19911980 Messages postés 22 Date d'inscription mardi 10 novembre 2020 Statut Membre Dernière intervention 14 octobre 2021
14 août 2021 à 00:41
merci beaucoup
0
Whismeril Messages postés 19025 Date d'inscription mardi 11 mars 2003 Statut Contributeur Dernière intervention 19 avril 2024 928
14 août 2021 à 07:40
de rien
0