Click here to Skip to main content
15,881,709 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Hi All,

I am a VB developer and now I have moved to VB.NET. I have few doubts which was easy to do VB 6.0 but not in VB.NET.

1. How to navigate in the property window?
Is there any short key to navigate in the property window.
For ex. in VB 6.0 I select a control and press F4 it opens the property window it happens the same in VB.NET as well, but in VB 6.0 we can navigate to any property by pressing Ctrl+Shift+(Initial Character of the property). For ex. If I have to go to its name property in VB 6.0 I will press Ctrl+Shift+N and it will move to the Name property of the control.

2. What is the need of "readonly" keyword in VB.NET to create a read only property as in VB 6.0 we can create read only property not to give the setter(Set) only getter(Get)?

I Googled but could not find a satisfactory result.

Thanks,
Sukhen Dass
Posted
Updated 12-Nov-11 4:08am
v2

1 solution

1. The shortcut key is still F4, but may depend on your settings (learn to use Visual Studio, it has nothing to do with VB).
2. The ReadOnly keyword[^]. I haven't given much thought to it (and neither should you, just accept it), but I like it because it shows IntelliSense that a Property is ReadOnly (having a regular Property with a Private Setter does not accomplish the same thing). But if I had to make a guess as to why it is absolutely necessary I'd guess it lets your compiler know that it does not have to create a Setter for the specified Property (IL does not create a set_Property Method). Might be better for performace. Same for WriteOnly Properties.
 
Share this answer
 
Comments
sukhen dass 12-Nov-11 9:38am    
thanks for your valuable time.
1.I know its F4 to open the property window...but my question is not how to open the property window my question is how to navigate in that property window.

2.you might be right about the readonly property...but if microsoft has given this it should be written somewhere in msdn but i dint find there in msdn and must be some purpose
Sander Rossel 12-Nov-11 10:01am    
Well, MSDN is not always correct or complete. C# can simply have properties and not define a setter. I guess no one just really asked WHY ReadOnly was necessary :)
The shortcuts in the Property Window itself I do not know. You can use the arrow keys and pageup/pagedown keys to navigate though. Hope you're not to keen on those shortcut keys...

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