Site Search:
Sign in | Join | Help
4Penny.net

VB.NET

Notes, Tricks and Tips on VB.NET

Keeping an MDI Child form from openining more than once in its parent

This simple piece of code will keep an MDI Child form from openining more than once in its parent

Private Sub mnuEnterBids_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuEnterBids.Click
Dim frm As New enterPriceBook

openform(frm)

End Sub

 

Sub openform(ByVal frm As Form)
Dim f As Form
For Each f In Me.MdiChildren

If f.Name = frm.Name Then

Exit Sub

End If

Next

frm.MdiParent = Me
frm.Show()

End Sub

Comments

No Comments

Leave a Comment

(required)  
(optional)
(required)  
Add

About Steve Gray

Steve is a seasoned (translate: old) developer in VB and ASP.NET. He spends most of his time in Dynamics GP, writing custom mods for consulting firms. Crystal reports, eConnect, VS Tools for Dynamics... anything that comes along.