You must Sign In to post a response.
  • Category: .NET

    How to call a user control to create a new control ?

    Hello friends,

    Created a new Tab Page User control using Windows Tab Page Control. I have to create a Chart User control in which Chart Control should be inside Tab Page User Control . Need Sample Code to Proceed .

    Thanks in advance
  • #768430
    Hi,
    Try this:

    public void CreateNewTab()
    {
    UserControl1 yourChartUserControl = new UserControl1();
    yourChartUserControl.Dock = DockStyle.Fill; //... Fill whole page with TAB
    TabPage yourTabPage = new TabPage(); //...This line creates new tabpage
    yourTabPage.Controls.Add(yourChartUserControl );
    tabControl1.TabPages.Add(yourTabPage);
    }


Sign In to post your comments