[英]How to disable button and then enable it after textbox.textchanged event?
[英]How to enable/disable a textbox with a button
我到处寻找这个,没有找到解决方案。
我想要的是,当我单击该按钮时,该文本框变为启用状态,因此我们可以在其中写入内容。
我试过了 :
public void button11_Click(object sender, RoutedEventArgs e)
{
textbox11.Enabled = true;
}
这是XAML代码
<TextBox Name="textbox11" IsEnabled="False".....>
但显然它不起作用。 我得到的错误:
'System.Windows.Controls.TextBox' does not contain a definition for 'Enabled' and no extension method 'Enabled' accepting a first argument of type 'System.Windows.Controls.TextBox' could be found (are you missing a using directive or an assembly reference?)
该控件没有名为“ Enabled”的属性。 尝试这个:
textbox11.IsEnabled = true;
注意“是”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.