locked
GUI design - Best practices RRS feed

  • Question

  • 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.
    Wednesday, January 9, 2008 6:33 AM

Answers

  • 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.

     

    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).

    Thursday, January 10, 2008 10:12 PM

All replies

  •  

    You can also use User Controls in Forms
    Wednesday, January 9, 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.

     

    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
    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
    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,

    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).

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

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