VB.NET中的属性快捷键 [英] Property Shorcut key in VB.NET

查看:95
本文介绍了VB.NET中的属性快捷键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!

晚上好,朋友.

VB.NET中是否有任何快捷键可以访问控件的特定属性,就像VB 6.0中的属性的Ctrl + Shift + FirstCharacter一样.我用Google搜索,但没有得到答案.
在VB中,假设我们必须访问文本框的text属性,
我们只需打开属性窗口和Ctrl + Shift + T(文本框的text属性的初始字符)即可.它直接定位到text属性,类似这样.
例如.
假设我在设计时绘制了一个文本框.按F4键,它会打开属性窗口以设置所需的属性.现在,我想要在该属性窗口中进行操作假设我必须更改其Name属性,但默认情况下,它会专注于其文本属性,现在我想通过键盘快捷键转到其name属性...在vb 6.0中发生.通过Ctrl + Shift + InitialCharacter(如果为name属性,则键为Ctrl + Shift + N即可进入其名称vb 6.0中的属性).


谢谢与问候
Sukhen Dass

Hi!

Good Evening, friends.

Is there any shortcut key in VB.NET to access particular properties of a control just like Ctrl+Shift+FirstCharacter of the property in VB 6.0. I Googled but didn''t get an answer.
In VB, suppose we have to access the text property of a text box,
we simply open property window and Ctrl+Shift+T (Initial character of text property of text box). It locates to text property directly, something like that.
For example.
Suppose I draw a text box at design time.As I Pressed F4 It opens the property window to set the property that i need.Now what I want in that property window Suppose i have to change its Name property but by default it focus on Its text property,Now i want to go its name property through keyboard shortcut...As it happens In vb 6.0.throught Ctrl+Shift+InitialCharacter(if it is name property the key would be Ctrl+Shift+N to go to its name property in vb 6.0).


Thanks & Regards
Sukhen Dass

推荐答案

按Ctrl + Space,将显示智能.然后键入所需的字符,它将基于键入的字符显示属性列表
Press Ctrl+Space,which will show the intelligence.Then type the character that you want,it will show the list of properties based on the typed character


您的问题不是很清楚.您是说在程序运行时并且用户按Ctrl + Shift + T时希望将焦点设置在特定的文本框中吗?

您可以通过向应用程序中添加菜单控件(如果不希望菜单实际显示出来,将可见性设置为false)并添加带有快捷方式的菜单项来执行类似的操作.然后将代码添加到菜单项的click事件中以执行设置焦点.

如果您需要其他帮助,请提供更多有关您要完成的工作的信息吗?
Your question isn''t very clear. Are you saying that when you program is running and the user presses Ctrl+Shift+T you want focus to be set on a specific textbox?

You could do something like that by adding a menu control to your application (with visibility set to false if you don''t want the menu to actually show up) and adding menu items with shortcuts to it. Then add code to the menu item''s click event to perform the set focus.

If you are asking for something else could you please provide more information about what you are trying to accomplish?


Kschuler的答案是使用隐藏的菜单控件,是否有兴趣?我可以看到在某些情况下这将是有用的.

不过,我要做的事情是首先将表单的 KeyPreview 属性设置为True,然后将其添加到表单的代码中:

Kschuler''s answer, to use a hidden menu control, is interest; I can see where that would be useful in a number of situations.

How I have done something like this, though, is to start by setting the KeyPreview property of the form to True, then adding this to the form''s code:

Private Sub Form1_KeyDown(ByVal sender As Object, _
ByVal e As System.Windows.Forms.KeyEventArgs) _
Handles Me.KeyDown
    If e.Control AndAlso e.Shift Then
        Select Case e.KeyCode
            Case Keys.D1
                TextBox1.Focus()
            Case Keys.D2
                TextBox2.Focus()
            Case Keys.D3
                TextBox3.Focus()
        End Select
    End If
End Sub



在这种情况下,我有一个带有三个TextBox控件的表单.当同时按下Ctrl,Shift和1、2或3个键时,相应的控件将获得焦点.



In this case, I have a form with three TextBox controls. When the Ctrl, Shift and either 1, 2 or 3 keys are pressed at the same time, the appropriate control gets the focus.


这篇关于VB.NET中的属性快捷键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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