Hi,
OK, am new to .net and am having some problems I can't seem to work out.
I have a form called frmExchange that has two buttons and a text box on.
what I want to do is type something into the text box and then click one button (btnAdd) which will then add that text to an arraylist and open a new form - ok can do that! here is the code:
Dim FaxNo As String
FaxNo = frmExchange.txtNewFaxMachine.Text
Dim frm As New frmFaxMachine(FaxNo, frmExchange)
frm.Show()
FaxArray.Add(FaxNo)
This then opens up the form that has the following:
Public Sub New(ByVal Num As String, ByVal ex As frmExchange)
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
exch = ex
myNumber = Num
Me.Text = myNumber
End Sub
What I want to be able to do is open as many forms as I want and then be able to reference them individually so I could close one. I want to be able to do this by typing in the instance name in the textbox of the first form and then click the second button (btnRemove) that will run
frm.close()
.
I have no idea how to do it - I was trying to assign the form a name and then try and refernce that - can anyone help??? PLEASE
Cheers
Ben
P.S. This is my first post so be kind ;)