gpt4 book ai didi

vb.net - 如何跳转到下一个文本框

转载 作者:行者123 更新时间:2023-12-04 05:26:47 24 4
gpt4 key购买 nike

我有 n 个文本框

text1.text = ""
text2.text = ""
...

表1
id txt1 txt2 txt3  

01 0 0 1
02 1 1 0
.....

txt1, txt2 是位数据类型

我想从 table1 检查文本框位是否为 0 然后我不想聚焦文本框,然后移动到下一个文本框如果位为 1 那么我想聚焦文本框。怎么做。

例如
table1

txt1 1
txt2 0
txt3 1

textbox1.focus then textbox3.focus.
textbox2 should not focus

我想写一个代码 leave_event 或得到焦点事件的哪个事件。任何建议

需要 VB.Net 代码帮助

最佳答案

我会使用 Enter 事件而不是因为 MSDN 注意到

the GotFocus and LostFocus events are low-level focus events that are tied to the WM_KILLFOCUS and WM_SETFOCUS Windows messages. Typically, the GotFocus and LostFocus events are only used when updating UICues or when writing custom controls. Instead the Enter and Leave events should be used for all controls except the Form class, which uses the Activated and Deactivate events.



您可以在那里使用您的逻辑并调用 SelectNextControl 如果这 TextBox不应该得到焦点。

关于vb.net - 如何跳转到下一个文本框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13122555/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com