views:

119

answers:

3

I wonder whether there are some guidelines that I can use for coding Winform applications in .net, preferably in C#?

For example, when I initialize data bindings for a form, shall I put the initialization code in the loading event of the form or in the constructor of the form? What is the correct way of adding controls/components from code rather than from designer? (Improper way may lead to undisposed controls/components). This sort of things.

Thanks for the help in advance.

+1  A: 

I know you're asking specifically for WinForms, but the classic first stop resource for design guidelines should be the Design Guidelines for Class Library Developers.

Once you have a good handle on that, you should be in a better place to answer questions specific to WinForms development like the ones you're asking based on these guidelines.

David Stratton
Very interesting article. Thanks David.
Steve
A: 

I would suggest you study someones (a skilled programmer) code. If you can find someone whom you personally know it would be even better. There are often small things that are not covered in guidelines but they does make a difference.

Umair Ahmed
Thank you very much. I think learning from someone else is indeed an efficient way. Thank you very much.
Steve
A: 

It's bit old, but if you are doing WinForm development, I highly recommend the following book, 'Windows Forms 2.0 Programming' by Chris Sells and Michael Weinhardt. I used the previous edition when I first learned how to do WinForm programming and it helped me a lot.

Chansik Im