Create a new window with XtraTabPage like the previous one Help please!

2

I want to create an object of a XtraTabPage that is equal to one that I already have that is to say that it has the same controls, this code allows me to create a new XtraTabPage but empty

Public Class Consultas
    Private Sub btnNuevaConsulta_Click(sender As Object, e As EventArgs) Handles btnNuevaConsulta.Click
        Dim tabSigConsulta As New XtraTabPage
        tabSigConsulta.Text = "Consulta " & (xtpManejoConsultas.TabPages.Count + 1)
        xtpManejoConsultas.TabPages.Add(tabSigConsulta)
    End Sub
End Class

    
asked by avargasma 15.04.2016 в 00:40
source

1 answer

1

I could create a User Control with the design you want to reuse, then adding this user control in each new tab.

Creating Windows Form User Control

Once you have control, you just create the instance and add it to the Controls collection.

Dim uc1 As New UserControl1()
tabSigConsulta.Controls.Add(uc1)

in this way you can reuse a design in the different tabs

    
answered by 15.04.2016 в 18:48