I am tryting to hide textbox when checkbox value is true which I've done but when unchecked the textbox doesn't hide what can I do to fix this?
Here is my code
private void textBox4_TextChanged(object sender, TextChangedEventArgs e)
{
}
private void checkBox_Checked(object sender, RoutedEventArgs e)
{
Handle(sender as CheckBox);
}
private void checkBox_Unchecked(object sender, RoutedEventArgs e)
{
Handle(sender as CheckBox);
}
void Handle(CheckBox checkBox)
{
bool chkd = checkBox.IsChecked.Value;
if (chkd)
{
textBox4.Visibility = Visibility.Visible;
}
else
{
textBox4.Visibility = Visibility.Hidden;
}
}