Click here to Skip to main content
15,890,123 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted
Updated 25-Aug-10 19:31pm
v3

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
 
Share this answer
 
Comments
Ankur\m/ 25-Aug-10 8:17am    
It's 'Intellisense'. :)
sukhen dass 25-Aug-10 8:40am    
I m not asking in the code window.But i m asking to work when property window is open.
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?
 
Share this answer
 
Comments
sukhen dass 26-Aug-10 1:29am    
thank u for the answer.But my question is.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.For More clarification pls post back.
Kschuler 26-Aug-10 8:57am    
So what you are asking for is a Visual Studio shortcut that will set focus to a certain property in the Properties Window at design time. I have never considered a need for this, but I suppose it could help you code a lot faster. I always just scroll to the property I want and click it with the mouse. I looked around in the Tools-->Options-->Keyboard section of options which is where you can set various shortcus, but I only found the F4 shortcut that brings the properties window up. Perhaps searching in there will help you find it. You can also change your shortcuts to try to match VB6 there...I didn't try it because I didn't want to mess up any of the shortcuts I've setup, but perhaps it is what you are looking for. Good Luck.
sukhen dass 27-Aug-10 7:20am    
thanks for your response to my posts...I know we can set the keyboard shortcut of our own in dot net but it only gives the key to set which is already defined or in menu.If you ever have worked in vb 6.0.Just open it and check the shortcut key to navigate through the properties if property window is open.
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:

VB
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


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.
 
Share this answer
 
No one could understand questioner.

Just like myself, he's worked in classical VB, where in design time you would hit F4 and property window would appear, then you would hit the starting character of a particular property, which would jump you to that property. For example, a label is drawn and you click on label and then press "C" and you'd go for Caption property etc.

Unfortunately, as far as I know, VS 2010 does not have this behaviour any more.

Regards.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900