I have a c# WinForm application that I need to generate TabPages at runtime. Ideally, I would like to design these tabpages using VS designer, but it seems that I can't directly do that as I can't drag and drop it from the toolbox (is there another way?).
I have two generic tabpages that I will be using multiple times. One that contains a simple spreadsheet and a couple textboxes and another with a graph and a couple textboxes. These pages will eventually get more complicated. I'm looking for the best method of doing this. I am presently just creating custom classes for each tab page and setting it as a TabPage base class. For example:
public partial class SpreadsheetTabPage : TabPage{}
I read that user controls offer some form of an alternative, but I don't really understand the advantages of using it vs. my method.
So to be clear, I want to know what you think is the best approach to developing these custom tabpages and why. Please provide a basic code example if relevant. My method is not really causing too much problems, but I see adding things to these pages later on will be difficult, particularly without use of the designer.
Thanks for your help in advance!