Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I can inheritance MDI form la,

 

But there are other problems:

I don't want to see a child MDI form is displayed twice.

(i.e. I don't have two instances showing)

 

In parent MDI form, a button click event:

       Dim childForm As frmRefTable

       childForm = childForm.getInstance()
       childForm.MdiParent = Me
       childForm.Show()
       childForm.BringToFront()

 

In Child MDI form,

   Public Shared frmChildForm As frmRefTable

   Public Shared Function getInstance() As frmRefTable
       If frmChildForm Is Nothing Then
           frmChildForm = New frmRefTable
       End If

       Return frmChildForm
   End Function

 

It seem to be work, but when i close the child form and open child form again, Error display:

 

An unhandled exception of type 'System.ObjectDisposedException' occurred in system.windows.forms.dll

 

Additional information: Cannot access a disposed object named "frmRefTable".

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...