为什么以应用程序代码形式"textbox1.focus();"形式加载不起作用 [英] why in form application code "textbox1.focus();" in form load does not work

查看:166
本文介绍了为什么以应用程序代码形式"textbox1.focus();"形式加载不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hii,每个人
我是乞gg
为什么以应用程序代码"textbox1.focus();"的形式出现形式加载不起作用
并仍将焦点放在textbox2中.为什么?

Hii , Every one
i''m begginer
why in form application code "textbox1.focus();" in form load does not work
and focus still in textbox2. why?

推荐答案

捕获form_loaded事件并将此事件textbox1.focus移到此处(到表单加载后). 加载表单时,焦点事件不在您的控件中.
Capture the form_loaded event and move this event textbox1.focus here (to after the form has loaded).
When the form is being loaded, the focus event is not in your control.


这篇关于为什么以应用程序代码形式"textbox1.focus();"形式加载不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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