开发者

how to disable the GotFocus on textbox?

开发者 https://www.devze.com 2023-04-09 11:44 出处:网络
I have a textbox that does something on GotFocus. How can I disable the GotFocus event on this textbox?

I have a textbox that does something on GotFocus.

How can I disable the GotFocus event on this textbox?

How to enabl开发者_StackOverflow社区e it back?

Sorry, I forgot - i work on Windows-mobile 6.5

Thanks in advance.


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.


May be TextBox.CanFocus = false; and then CanFocus = true; ?


if you use WPF, TesxBox.Focusable property should be used. TesxBox.Focusable = true enables you to got focus. TesxBox.Focusable = false - disables you to got focus

0

精彩评论

暂无评论...
验证码 换一张
取 消