in

Platinum Bay

Peace, Love, and Visual Studio ALM

This Blog

Syndication


.NETicated

Taming the Visual Studio WinForms Designer

Here's a new Visual Studio tip I picked up recently. I have built my share on WinForms apps, and most of them had extraneous labels to denote input fields or other areas of the form. I don't use them, their just placeholders for text.

It used to be that when I was working on the code side (F7), I would wander through IntelliSense, trying to ignore the Label1, Label2, Label3 suggestions. No more.

Simply select the items on the form that you don't want to code against, highlighted in red below. Next, go to the Properties tool window and set the GenerateMember property in the Design group to False. If you take a peek in the form's designer file, you will see that the field declarations have been moved into the InitializeComponent method. What this does is remove it from IntelliSense's prying eyes, while still allowing it to be rendered for yours.

Now, when I am perusing through IntelliSense, I will only see generated members for the fields I actually need (green below).

Comments

December 9, 2007 11:16 PM

ASP.NET Asp.Net Control For Google Charts [Via: Luke Foust ] Sharepoint Forms based apps with Infopath...

 

December 9, 2007 11:17 PM

Link Listing - December 9, 2007

 

Leave a Comment

(required )  
(optional )
(required )  
Add

About Steve

Steve Andrews is an independent consultant, INETA speaker, and Microsoft MVP for Visual Studio ALM. He has been working in technology for over ten years focusing on custom application development and Application Lifecycle Management. Steve is also Microsoft and IBM certified and a community fanatic having led sessions at nearly 100 events across North America. When he's not developing software solutions or engaging with the community about software technology, Steve is a closet singer and songwriter and plays the guitar and keys. Occasionally, Steve even gets to sleep. Occasionally.
Powered by Community Server (Commercial Edition), by Telligent Systems
© Platinum Bay | Some Rights Reserved Creative Commons License

Disclaimer: The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion. Feel free to challenge me, disagree with me, or tell me I'm completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever (abusive, profane, rude, or annonymous comments) - so keep it polite, please.