Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim newform As New formBuilder.formAssembler(Me)
End Sub
End Class
Namespace formBuilder
Public Class formAssembler
Private form1 As Form
Private textboxMain As New formTextBox
Private textboxEntry As New formTextBox
Sub New(ByRef formA As Form)
form1 = formA
'define the form itself
form1.ClientSize = New System.Drawing.Size(700, 700)
'Main textbox
textboxMain = New formTextBox()
textboxMain.mainTextBox()
textboxMain.addtextbox(form1)
'entry textbox
textboxEntry = New formTextBox()
textboxEntry.secondaryTextBox()
textboxEntry.addtextbox(form1)
End Sub
End Class
Public Class formTextBox
Private textBoxBuilder As TextBox
Sub New()
textBoxBuilder = New TextBox
End Sub
Sub secondaryTextBox()
textBoxBuilder.Name = "secondaryTextBox"
textBoxBuilder.Multiline = True
textBoxBuilder.Location = New System.Drawing.Point(150, 320)
End Sub
Sub mainTextBox()
textBoxBuilder.Name = "textboxMain"
textBoxBuilder.Multiline = True
textBoxBuilder.Location = New System.Drawing.Point(150, 100)
textBoxBuilder.Size = New System.Drawing.Size(200, 200)
End Sub
Sub addtextbox(ByRef formA As Form)
formA.Controls.Add(textBoxBuilder)
End Sub
End Class
End Namespace
No comments:
Post a Comment