I have a C # WinForm application that I need to create TabPages at runtime. Ideally, I would like to create these tabs using the VS designer, but it seems that I cannot do this directly, since I cannot drag it from the toolbar (is there any other way?).
I have two general tabs that I will use several times. One that contains a simple spreadsheet and a couple of text fields, and the other a graphic and a couple of text fields. These pages will eventually become more complex. I am looking for a better way to do this. Currently, I just create custom classes for each bookmark and set it as the base class of the TabPage. For instance:
public partial class SpreadsheetTabPage : TabPage{}
I read that user controls offer some form of alternative, but I really don't understand the benefits of using this method against my method.
So, to be clear, I want to know what you think is the best approach to developing these customizable tablets and why. If necessary, provide a sample base code. My method does not actually cause too many problems, but I see that adding things to these pages will be difficult later, especially without using a designer.
Thanks for your help in advance!
source share