Openning Forms - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Openning Forms

RicardoFurtadoRicardoFurtado Posts: 205Member
I'm trying to open a form from inside another form, and the problem is that i can't open the form unless i open it as modal.
If i use the menus of an MDI form, that has its IsMDIContainer set to true, i can open as many child forms as i want, but i'm trying to open a child of the Mdi form, from inside another child of the MDI form.
The code i'm using, to try to open the form, is this:

Dim frmMyForm As New frmImageCapture

frmMyForm.MdiParent = Me
frmMyForm.Show()



but once i this code doesn't work, i'm openning it as modal:

Dim frmMyForm As New frmImageCapture

frmMyForm.ShowDialog(MDIGestCeph)


Is something wrong with the first code? How can i open an mdi child form from inside another mdi child form? has it anything to do with .Net Security?

My thanks in advanced

Comments

  • PavlinIIPavlinII Posts: 404Member
    : I'm trying to open a form from inside another form, and the problem is that i can't open the form unless i open it as modal.
    : If i use the menus of an MDI form, that has its IsMDIContainer set to true, i can open as many child forms as i want, but i'm trying to open a child of the Mdi form, from inside another child of the MDI form.
    : The code i'm using, to try to open the form, is this:
    :
    : Dim frmMyForm As New frmImageCapture
    :
    : frmMyForm.MdiParent = Me
    : frmMyForm.Show()
    :
    :
    :
    : but once i this code doesn't work, i'm openning it as modal:
    :
    : Dim frmMyForm As New frmImageCapture
    :
    : frmMyForm.ShowDialog(MDIGestCeph)
    :
    :
    : Is something wrong with the first code? How can i open an mdi child form from inside another mdi child form? has it anything to do with .Net Security?
    :
    : My thanks in advanced
    :
    Hi,
    do you have Me.IsMdiContainer = True?

    I've created Form1, set IsMdiContainer=True, created Form2 and wrote
    [code]
    Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim f2 As New Form2
    f2.MdiParent = Me
    f2.Show()
    Dim f3 As New Form2
    f3.MdiParent = Me
    f3.Show()[/code] and Form1 appeared, with two child form inside of it.. is this what you desired?

    Hope this helps

    [blue][b][italic][size=4]P[/size]avlin [size=4]II[/italic][/size][/b][/blue]

    [purple]Don't take life too seriously anyway you won't escape alive from it![/purple]


Sign In or Register to comment.