进入页面时,自定义向导将焦点设置为控件 [英] custom wizard set focus to a control when entering a page

查看:68
本文介绍了进入页面时,自定义向导将焦点设置为控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当页面出现时,如何在焦点页面的文本框上调用焦点事件?我有自定义向导的修改版本.
[edit]已删除代码块,忽略HTML ..."选项已禁用-OriginalGriff [/edit]
[edit]已删除".这个词是已删除",而不是已添加":O-OriginalGriff [/edit]

解决方案

这可能会或可能不会回答您的问题,但最终成功了"不利于您检查所关注页面上控件的选项卡顺序.确保TextBox的编号最小,并且它应该自动获得焦点.您甚至不应调用此类对象,而应集中精力,然后将事件作为结果调用.只需拨打Control.Focus.

程序化聚焦可能是非常合理的,但是在许多情况下,这可能是设计错误的标志.考虑一下,然后非常精确地审查或可能重新考虑设计.

—SA


How can I invoke a focus event on a textbox on an interim page when the page appears? I have a modified version of the custom wizard.
[edit]Code block removed, "Ignore HTML..." option disabled - OriginalGriff[/edit]
[edit]"Removed". The word is "Removed", not "Added" :O - OriginalGriff[/edit]

解决方案

This may, or may not answer your problem but it won''t hurt you to check that tab-order of the controls on the page you are concerned about. Make sure that the TextBox has the lowest number and it should automatically get focus.


You cannot invoke a focus event, and event if you could, it would be completely wrong. You should not invoke such even, you should focus, then the event would be invoked as a result. Just call Control.Focus.

Programmatic focusing can be quite reasonable, but in many cases it can be a sign of design mistake. Think about it and review or possible re-think the design very accurately.

—SA


这篇关于进入页面时,自定义向导将焦点设置为控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆