I created a user control (CorpControl) with a handful of controls as text boxes (txtTaxID) , combo boxes (cboHQ), button and datetimepickers.
Public Class CorpControl
Private Sub CorpControlControl_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Public Property TaxID() As String
Get
Return txtTaxID.Text
End Get
Set(ByVal value As String)
txtTaxID.Text = value
End Set
End Property
Public Property CorpName() As String
Get
Return txtCorpName.Text
End Get
Set(ByVal value As String)
txtCorpName.Text = value
End Set
End Property
End Class
I added a class to my project CorpClass
Public Class CorpClass
Inherits TabPage
Public Sub New()
Me.Controls.Add(New CorpControl)
End Sub
End Class
I added this tab page to a tab control in my form:
Dim tpCorp As New CorpClass
tpCorp.Text = "Corporate Information"
tpCorp.name = "tpCorp"
TabControl1.TabPages.Add(tpCorp)
TabControl1.SelectedTab = tpCorp
Tried setting values to the controls but getting errors
tpCorp.TaxID = "123"
Can anybody show me how to assign values to the textboxes (for now) in this new tab?
Any help will be greatlyu appreciated.
Public Class CorpControl
Private Sub CorpControlControl_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Public Property TaxID() As String
Get
Return txtTaxID.Text
End Get
Set(ByVal value As String)
txtTaxID.Text = value
End Set
End Property
Public Property CorpName() As String
Get
Return txtCorpName.Text
End Get
Set(ByVal value As String)
txtCorpName.Text = value
End Set
End Property
End Class
I added a class to my project CorpClass
Public Class CorpClass
Inherits TabPage
Public Sub New()
Me.Controls.Add(New CorpControl)
End Sub
End Class
I added this tab page to a tab control in my form:
Dim tpCorp As New CorpClass
tpCorp.Text = "Corporate Information"
tpCorp.name = "tpCorp"
TabControl1.TabPages.Add(tpCorp)
TabControl1.SelectedTab = tpCorp
Tried setting values to the controls but getting errors
tpCorp.TaxID = "123"
Can anybody show me how to assign values to the textboxes (for now) in this new tab?
Any help will be greatlyu appreciated.