MDI Child Dissapearing in parent (VB)

Algar

Active member
Joined
Jun 17, 2003
Messages
28
Location
Toronto
MDI Child Dissapearing in parent

I created VB.NET MDI Parent and Child Forms.

Everything works great except that when I move the child form around inside the parent container, it does not refresh (repaint?) the child. Everything works good if I add a .refresh to the child forms move event, except the caption bar at the top of the form doesnt refresh.

Seems to me like it should handle this by itself so maybe I am missing some property somewhere ?

Thanks for any assistance.
 
Last edited by a moderator:
RE

try this for your form move changing Form2 to whatever your child form is of course :)

Code:
Public i as integer
Private Sub Form2_Move(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Move

        i += 1
        Me.Text = i & " Number of times moved"
        Me.Refresh()

    End Sub

The caption at the top should change each time you move it and tell you how many times its been moved. If it dosnt then is it possible you are overriding the onPaint in some way?
 
I have tested every event and they are all triggering . I havent even written code yet, so I dont think im overiding the OnPaint.

Whats funny is that I just went back to VB6.0, created 2 forms frmParent and frmChild. Made a menu buttom that:

Dim F as New frmChild
F.Show()

and it works perfectly.

I returned to VB.Net did the exact same thing and got the same problem as before.

Any further assistance would be appreciated.
 
Problem solved. Unfortunately I never managed to learn what the problem was.

Ok, so I imported my vb6 project that worked good. After importing to .net it worked good in there also. So I compared all properties between the 2 forms in the 2 didfferent projects and they were identical. So I close both vb6 and .net down, reopen .net and my Project and suddenly it works ????

Well as long as its working im happy, but I sure wish I new what the problem was...

Thanks to those who helped !
 
re

thanks about the sign :)
Im glad it worked out but yea i wish we could have learned what the trouble was.
 
Back
Top