Issue Will Form Load

oggmorg

Member
Joined
Jan 25, 2012
Messages
16
Programming Experience
1-3
i have a problem when calling a form from my main, it loads like this.
Untitled.png

i can load other forms fine.. its just this one, it should show a picturebox, and a label in the center has anyone seen this before??
 
have you set the Main menu's isMdiContainer property to True? and the set the second form as a child form of the main one?
 
have you set the Main menu's isMdiContainer property to True? and the set the second form as a child form of the main one?

arrgh how annoying. ive tried what you said. and no "IsMdiContainer = True" doesnt help.. heres my code.
FROM MAIN
dialer.Show()
dialer.doit()

IN DIALER
Public Class dialer
Private Sub dialer_load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Label1.Text = "..Loading.."
IsMdiContainer = True
End Sub
Sub doit()
`````````````````````
``````````````````````
end sub

(i have application framework turned off)
 
ok so the issue is that it needs to complete the form1_load sub before displaying the form correctly... but how do i prompt it to do anything after that?? without any user imput? i cant get it to return the the main to prompt the next sub... please can someone help with this. its the final issue with this program.
 
scrach that. ive managed to now get it to return using .show() instead of the showdialogue(). but it now shows without the text again.. it loads fine using showdialogue but doesnt return to allow me to continue!! what is this!?
 
okay, I've re-created your situation as you've described in your previous post.

Here your main form. I suppose you're using a menu to call other forms?


2q9x40l.png


I've included a picturebox and a label as you've said in one of the forms. I can view all 3 forms with no problem.


m9awih.png


btw you have done it wrong in your code. You should set the IsMdiContainer property to True in the Main From. Try this code,


VB.NET:
Public Class frmMain


    Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


        IsMdiContainer = True


    End Sub


    Private Sub Form3ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Form3ToolStripMenuItem.Click


        Dim frmThree As New frmThree
        frmThree.MdiParent = Me
        frmThree.Show()


    End Sub


End Class
 
Back
Top