in

Platinum Bay

Peace, Love, Team System, and Community

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 a Team System MVP and INETA Speaker, and has been working as a developer for more than 9 years. During this time, he has designed and developed applications in such widely varying areas as trust accounting, medical information management, supply chain management, and retail systems. Steve is also an MCP, ICSOO, Speaker Liaison for the Philly .NET User Group, and community fanatic.
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.