Windows Develop Bookmark and Share   
 index > Windows Forms General > GUI design - Best practices
 

GUI design - Best practices

Hi,

I have to design a windows application. What is the best practices to consider when designing windows applications ? In ASP.NET, user controls/Master pages can be used to give design layout. Is it possible to do something like that in windows forms, so that I can keep the common part in only one file.
Navaneeth  Wednesday, January 09, 2008 6:33 AM

Hi,

The nearest equivalent for the master page is using visual inheritance, and also as Stefan said using user controls...both options will help you a lot to reuse code and to keep a coherent interface in all your application.

ruben_ruvalcaba_camba  Thursday, January 10, 2008 2:50 AM

Yes you are correct. If you need to ran the parent button_click too just call base.Button_Click(sender, e).

JRQ  Thursday, January 10, 2008 10:12 PM

You can also use User Controls in Forms
StefanW nler  Wednesday, January 09, 2008 8:14 AM

Hi,

The nearest equivalent for the master page is using visual inheritance, and also as Stefan said using user controls...both options will help you a lot to reuse code and to keep a coherent interface in all your application.

ruben_ruvalcaba_camba  Thursday, January 10, 2008 2:50 AM
If you want something like a stylesheet for the form, you can always create a base controls with all the settings, and then inherit em.

One point about best practice in my view, would be to have the layout as flexible as possible, for that use the TableLayoutPanel / Anchors effectively.

cheers
_krafty_  Thursday, January 10, 2008 5:06 AM
Hi ruben_ruvalcaba_camba

That was excellent suggestion. I have implemented visual inheritene and it rocks. Thanks. I have some qury regarding event handling. Now my base form contains a button. How I can handle this event in the child form ? What I have done is overriding the base form button click event handler in inherited form. Is this the right way to do ?

Thanks again
Navaneeth  Thursday, January 10, 2008 7:14 AM

Hi Navaneeth,

Is good to know it helps you! ... about handling the events in the child forms, in my point of view overriding the event handlers is the right way to do this, so you can write basic functionallity in the parent form and change it as you need in the inheritors.

Regards,

ruben_ruvalcaba_camba  Thursday, January 10, 2008 4:02 PM

Yes you are correct. If you need to ran the parent button_click too just call base.Button_Click(sender, e).

JRQ  Thursday, January 10, 2008 10:12 PM
Hi All,

Thanks for helping me.
Navaneeth  Friday, January 11, 2008 6:32 AM

You can use google to search for other answers

Custom Search

More Threads

• How do I set a ComboBox to ReadOnly?
• SmartCard
• crystal report viewr
• Resize form inside control?
• Background Process Issues
• Property Grid: Adding new 'expandable' objects
• Winforms keyboard navigation
• Drag Drop Custom Control
• Multiple forms and process order
• Custom Control inside another control (user control)