I have a CheckBox and a TextBox. During the runtime,
if the CheckBox is Checked then the TextBox is enabled.
I did it using following code
private void checkTime_Checked(object sender, RoutedEventArgs e)
{
if (checkTime.IsChecked == true)
{
txtTime_SR.IsEnabled = true;
}
}
What I need to do is, to disable the TextBox when the CheckBox is Unchecked during runtime.
Any idea of doing this ?
Reading your post and comments, I’ll guess you are doing WPF or silverlight.
Then, in that case, you may do it all in XAML :
Then, you need to create the converter. This can be done by reading post here : How to bind inverse boolean properties in WPF?
Hope it helps