SSW Update - Do you use inherited forms for consistent behaviour??
Microsoft Gold Partner Logo

 

[ the cutting edge ]

G'Day Developers!

If you ask a new .NET developer (from the Access or VB6 world) what is the best thing about .NET Windows Forms, most of your answers will be "Form Inheritance" that allows them to keep a nice consistent look for all forms. If you ask them a couple of months later, they will probably tell you the worst thing about .NET Windows Forms is "Form Inheritance". This is because they have had too many problems with the bugs in the form designer regarding this feature. Many abandon them altogether and jump on the user control band wagon. Please don't, I have a solution to this....

I think if you can keep the level of form inheritance to a minimum, then you may not see the problem or at least you will experience the problem less. Anyway even if you do, stop whinging and just close down Visual Studio.NET and restart. You don't change the base form that often anyway.

Well how do you keep it to a minimum? Well make the first base form without any controls, only code (to make it as flexible as possible and avoid having a multitude of base forms).

We try to keep the number of controls on inherited forms, and the levels of inheritance to a minimum, because it reduces the risk of problems with the Visual Studio Designer (you know when the controls start jumping around, or disappearing from the Designer, or properties getting reset on inherited copies or even the tab order getting corrupted). Designer errors can also occur in the task list if the InitializeComponent method fails.

Every form in your application should inherit from a base form which has code common to every form. See our examples.

Cheers until next time, Adam
SSW Chief Architect and Microsoft Regional Director, Australia 

Got a comment for Adam? 6164616d636f67616e407373772e636f6d2e6175

Sydney .NET User Group -
The best place to learn .NET for free in Sydney

User Group

2 days to go!

Sydney .NET User Group
Wednesday 16th January 2008
5:45pm - 9:00pm
Microsoft, Sydney

Best Practices for Team-Based Software Development
By Anthony Borton, Microsoft

A highly cohesive software development team is critical to a successful project. In this session, we examine all of the different ways teams members, from project managers to developers and QA, can work together to help enhance team collaboration, and ultimately process success. We then take a look at how these opportunities map into Microsoft Visual Studio Team System and other Microsoft products to show you how you can take advantage of these best practices on your teams today. This is a must see session for anyone either considering adopting VSTS or wanting to increase their productivity with VSTS.

Anthony Borton is a VSTS consultant and trainer based in Brisbane. He is a Microsoft Team System MVP and runs the Queensland VSTS Users Group. He has been involved in training for over 15 years and is the Microsoft Technical Readiness trainer for Visual Studio Team System 2005/2008 and Windows Server 2008:Developer and Architect.

See You There!!!| Sorry I can't make it

Featured Product: SSW Access Reporter

SSW Access Reporter Get your Access reports on the web with SSW Access Reporter

Delivering reports on the web can be expensive and time consuming, especially when you're faced with the task of converting existing Access reports. SSW Access Reporter was designed for the .NET developer moving from legacy Access Applications to ASP or ASP.NET. If you are a Access developer and want help to bridge the .NET migration gap, this utility allows you to deliver your existing, great-looking Microsoft Access reports online now!

More on SSW's Access Reporter

Advertise with SSW

If you would like to advertise your product or service with SSW or would like to find out more about various advertising opportunities, please email your enquiry to 736f7068696562656c6c65407373772e636f6d2e6175
or call: +61 2 9953 3000.

Camtech 2008 Web Developer Offer
Proudly developed by SSW Sydney Web Design