By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,285 Members | 1,647 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,285 IT Pros & Developers. It's quick & easy.

VB.NET + MDI

P: n/a
Hi All!

I have following problems while working with the VB.NET and MDI forms. I
have a form that is an MDI Parent and some MDI Child forms that are created
by the buttons on the parent form.

The first problem is that I do not really know how to limit the buttons so
they will be able to open only one instance of specific MDI Child form.

The second problem is that I do not know how should I reffer to the
controls/variables that are part of the MDI Child forms. In other words I
cannot simply allow MDI Child forms to exchange data/variables between
eachother.

Can you please help me solving these problems?

Regards,

Piotr

Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Piotr,

Maybe you can use this. (watch typos a lot is typed in this message)

\\\
Private Sub mnuFrmHandling(ByVal frmName As String)
For Each frm As Form In Me.MdiChildren
If frm.Name = frmName Then
frm.BringToFront()
Exit Sub
End If
Next
Dim frmNew As Form
Select Case frmName
Case "Persons"
frmNew = New frmPersons
Case "blabla"
frmNew = New frmBlaBla ' and all other forms after that
frmNew.myproperty = "Hello There"
Case Else
frmNew = New frmStandard(frmName)
End Select
frmNew.MdiParent = Me
frmNew.Show()
frmNew.WindowState = FormWindowState.Maximized
frmNew.Name = frmName
frmNew.BringToFront()
End Sub
///

You can find the parent form in a MDI form by using this in the mdi.
me.parent. (You cannot go directly from one MDI class (form) to another MDI
class)

I hope this helps a little bit?

Cor

I have following problems while working with the VB.NET and MDI forms. I
have a form that is an MDI Parent and some MDI Child forms that are created by the buttons on the parent form.

The first problem is that I do not really know how to limit the buttons so
they will be able to open only one instance of specific MDI Child form.

The second problem is that I do not know how should I reffer to the
controls/variables that are part of the MDI Child forms. In other words I
cannot simply allow MDI Child forms to exchange data/variables between
eachother.

Can you please help me solving these problems?

Regards,

Piotr

Nov 21 '05 #2

P: n/a
thanx rich! i'll tune it up and surly make a use of it!

Piotr

Użytkownik "Cor Ligthert" <no**********@planet.nl> napisał w wiadomo¶ci
news:Op**************@TK2MSFTNGP11.phx.gbl...
Piotr,

Maybe you can use this. (watch typos a lot is typed in this message)

\\\
Private Sub mnuFrmHandling(ByVal frmName As String)
For Each frm As Form In Me.MdiChildren
If frm.Name = frmName Then
frm.BringToFront()
Exit Sub
End If
Next
Dim frmNew As Form
Select Case frmName
Case "Persons"

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.