C# GUI Programming
Posted on 2007-07-24
I need to preface that I am a Java programmer that is new to C#, and I am having difficulty finding information on GUI design.
My methodology for Java GUI programming is to subclass the JPanel class for each main component on a GUI display. I create custom layouts for each of these subclassed JPanels and then attach them to the main JFrame using another custom layout.
I have already figured out the custom layouts in C# and the Form class. What I am having difficulty with is subclassing Panel. From what I can see, it looks like this needs to be created using a new UserControl. Once created, change the superclass from UserControl to Panel. I am not sure if this is right, but it is easy. Once created though, I have no way of adding the new control to my Form. By the looks of what I am able to find, I need to save this subclassed Panel to a separate dll and then reload it back in as a reference. This means that I would need to split my application into at least 2 pieces (main .exe and subclassed Panel .dll).
Can some one please let me know if this is really how I need to do this or if there is a better way. I would like to have everything (main application and all GUI components) in the main .exe file. Also if there is a better way to subclass Panel, please let me know. And lastly, if there is overall a better way of doing what I am trying to accomplish, keeping in mind I would like to use custom layouts, I would appreciate the information.