Click to See Complete Forum and Search --> : Multiple forms


pantara27
November 24th, 2002, 03:55 PM
when I add new forms in my project I need to declare the form just before I use it or I get an error that the for is not shared if I declare it and use it in one control the others still do not recocgnize it . and when I declare it in the form1 load it still is'nt recognized how can I make additional forms public in the project so that I can show them or access thier controls from any control in the project.

Please Help!!!
TNX Pantara27

Angelicus
November 25th, 2002, 12:25 AM
If I'm understanding the question correctly, declare the form on each form and then call it with a frmName.Show()

Like in the program I'm workin with on....

I have frm1,frm2,frm3,frm4,and frm5. Now lets say I want to access frm5 from all the others, I would:

(on frm1,frm2,frm3,and frm4)

Dim MyForm As New frm5()

(to show the form)

Private Sub MenuItem16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem16.Click
MyForm.Show() 'could also use MyForm.ShowDialog()
End Sub