views:

29

answers:

2

This is more of a design question.

The requirement is to have a winform with multiple buttons. Each button may either open another form with multiple buttons or open a function form e.g. add orders etc. So basically we have menu forms (made up of buttons) and function forms (the functionality the app provides).

Because this is a product with multiple clients, we need to enable/disable/hide/show buttons based on the features client have bought.

What would be the best to implement this kind of heirarchical menu of buttons?

Thanks.

A: 

Put the menu (navigation) buttons on a menu and the function buttons on a docked toolbar.

Beth
err when I said its a design question, I didn't mean UI design.
nEEbz
A: 

Ok what we did was as follows,

we had two options:

  1. Keep everything in the database, all the heirarchy of menu and buttons. Create a single generic menu form and then create the buttons in the form on the fly. It looked great on paper but we had two issues with it. a) First creating buttons on the fly meant we had to implement their click functionality (i.e. which form to open up on click) in a single generic function which opens the form through reflection. That was limiting us because we had issues to pass custom parameters to the form. We could've add multiple functions for that but then that would've created one big class with a lot of functions. Not exactly generic. b)Secondly we creating a single form for all menus meant we could not customize the form (like add other controls in header/footer) for different forms. Again we could've done that but that would've again required a lot of ifs etc.

  2. Create all the menus and buttons statically at the UI layer. And enable/disable/hide/show them based on table values/configuration. It was more work than #1 but it allowed us a lot of flexibility in terms of our UI layout.

nEEbz