Tabbed environments brings with it clutter?
-
I recently spotted this post, included in the Code Project Insider newsletter: http://www.codeproject.com/lounge.asp?msg=1992197#xx1992197xx[^] I got me thinking, we are currently building an app that makes use of tab-like panels, similar to VS2005. Where each panel may deal with completely different aspects. It has a great feel and allows for quite a bit of customization (particularly layout) of the user-interface by the user. But what I hate is that now all your code goes into 1 file/form. (Not even using Regions helps!) What do you think is the best approach to "compartmentalize" your code in a "per panel" manner as such? I have started using partial classes and this seems to work OK. Any other ideas or am I the only one that hates thousands of lines of code in the same file/form??:doh: Francois (Sorry if this is in the wrong forum)
-
I recently spotted this post, included in the Code Project Insider newsletter: http://www.codeproject.com/lounge.asp?msg=1992197#xx1992197xx[^] I got me thinking, we are currently building an app that makes use of tab-like panels, similar to VS2005. Where each panel may deal with completely different aspects. It has a great feel and allows for quite a bit of customization (particularly layout) of the user-interface by the user. But what I hate is that now all your code goes into 1 file/form. (Not even using Regions helps!) What do you think is the best approach to "compartmentalize" your code in a "per panel" manner as such? I have started using partial classes and this seems to work OK. Any other ideas or am I the only one that hates thousands of lines of code in the same file/form??:doh: Francois (Sorry if this is in the wrong forum)
Why does all your code go into one form? Surely it should be divided according to purpose. The only code that should go into one form is the code to manage the tabs. Each tab then uses code from a component built for the content of that tab.
-
Why does all your code go into one form? Surely it should be divided according to purpose. The only code that should go into one form is the code to manage the tabs. Each tab then uses code from a component built for the content of that tab.
Thank you for responding, it is a valid question. Let me clarify. The form does use classes and other components to do the "work". In make case however you have multiple tab-panels not of the same instance as such each tab-panel has a unique set of controls (buttons, grids, etc). I am refering to the many even handlers for each of these controls; purly UI code. This, at least for me, becomes "too much" code on one form. Although as I am busy typing this I think think I just figured out what you may be refering to - coding each tab as a component, a custom control as such and then just addint the control to the tab? It makes sense *feeling stupid* - it this what you were saying? Francois
-
Thank you for responding, it is a valid question. Let me clarify. The form does use classes and other components to do the "work". In make case however you have multiple tab-panels not of the same instance as such each tab-panel has a unique set of controls (buttons, grids, etc). I am refering to the many even handlers for each of these controls; purly UI code. This, at least for me, becomes "too much" code on one form. Although as I am busy typing this I think think I just figured out what you may be refering to - coding each tab as a component, a custom control as such and then just addint the control to the tab? It makes sense *feeling stupid* - it this what you were saying? Francois
Yes, that's exactly what I am saying. Don't feel stupid, it's coming to realisations like this in a real world scenario that teach more than just the written word can ever hope to.
-
Yes, that's exactly what I am saying. Don't feel stupid, it's coming to realisations like this in a real world scenario that teach more than just the written word can ever hope to.
Makes perfect sense! Can't believe I didn't think of that. Oh well :) Would still be interesting if anyone else has another approach. There is often more ways then one to skin a cat :doh: