[英]how to disable the GotFocus on textbox?
I have a textbox
that does something on GotFocus
. 我有一个在
GotFocus
上做某事的textbox
。
How can I disable the GotFocus
event on this textbox
? 如何在此文本
textbox
禁用GotFocus
事件?
How to enable it back? 如何启用它?
Sorry, I forgot - i work on Windows-mobile 6.5 对不起,我忘了 - 我在Windows-mobile 6.5上工作
Thanks in advance. 提前致谢。
May be TextBox.CanFocus = false;
可能是
TextBox.CanFocus = false;
and then CanFocus = true;
然后
CanFocus = true;
? ?
You could always Enable or Disable the control as well 您也可以始终启用或禁用控件
void ButtonEnabled(bool value) {
textBox1.Enabled = value;
}
The code above is much too short to write a routine for, but gets the point across easier. 上面的代码太短,无法编写例程,但更容易理解。
if you use WPF , TesxBox.Focusable
property should be used. 如果使用WPF ,
TesxBox.Focusable
使用TesxBox.Focusable
属性。 TesxBox.Focusable = true
enables you to got focus. TesxBox.Focusable = true
使您TesxBox.Focusable = true
焦点。 TesxBox.Focusable = false
- disables you to got focus TesxBox.Focusable = false
- 禁用您获得焦点
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.