自动完成框的焦点事件 [英] focus event for autocomplete box

查看:50
本文介绍了自动完成框的焦点事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好



任何人都可以告诉我如何在加载时将焦点设置在自动完成框上..



谢谢你

Hi all

Can anyone tell me how to set focus on a autocomplete box while load..

Thank you

推荐答案

这听起来不是很明显所以贬低你的问题并没有尝试过对于他们自己。



显而易见的解决方案是使用类似
This isn''t as obvious as it may sound so it''s a shame whoever downvoted your question didn''t try it out for themselves.

The "obvious" solution is to use something like
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Me.TextBox1.Focus()
End Sub



但是你会问uickly发现,这不起作用,因为标签顺序将接管。

你有几个选择...


But as you''ll quickly find out, that doesn''t work as the tab order will "take over".
You have a couple of options ...

Me.TextBox1.TabIndex = 0




or

Me.TextBox1.Select()

将同时工作





Tabindex无法在该控件上运行 - 尝试确保自动填充框是XAML中列出的第一个控件,并且tabindex为任何控件设置 not


这篇关于自动完成框的焦点事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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