HELP - MDI Form with SDI - SDI hidden by MDI objects

P

Pedro

Hi all;

I have one MDI form, with it's IsMDIForm property set to true, which
has lot's of components (panels, toolbars, menus, explorer bars,
etc.). I also have one SDI form, and somewhere in my code i do this;

'MDI FORM - toMainForm
'SDI FORM - loPreview

....
Dim loPreview as new Form
loPreview.MdiParent = toMainForm
loPreview.Show()
....

This aparently works fine, but my SDI form shows behind of my Mdi form
components. I checked my SDI form and it's visible property is set to
true and the object is acessible when created and invoked. I've tryed
with a simple app.
and sdi form is loaded and activated correctly, but remains on the
back of my Mdi objects!... Tryed also bringing Sdi form to the front
of z-order, selecting it, giving it the focus, refreshing it, but
nothing works!...

Why? Is it a .NET bug? No other solution is available form me, 'cause
i need my loPreview to interact with toMainForm objects and if i add
loPreview to toMainForm a strange behavior occurs when interacting
with each other.

I think MDI's logic is to ensure this kind of needs (mdichild forms
can interact with mdiparent form). How can i workaround this issue?

I'm strugling with this for quite some time, and any help would be
greatly appreciated!

Please, help is urgent!

Thanks in advance!
 
P

Pedro

Hi all;

My feelings tell me that i've reached a dead end. No one seems to had
this issues or reported this kind of problems with MDIs and no one has
a clue.
I guess my only solution is to work with SDIs and loose MDI's
interactivity.

Although, i thougth someone would reply since my first post! It's sad
when no one reply to your posts, no matter if they have or not the
rigth answer!

Thanks anyway!
 
A

Antonio

Hello Pedro,

Did you try to define the MainForm as well?

Dim theMainForm as New toMainForm
Dim loPreview as new Form
loPreview.MdiParent = theMainForm
loPreview.Show()
 
P

Pedro

Hi Antonio and thanks for replying;

I'm not sure if i made myself clear on this:

My MDI toMainForm already exists and it's already defined. What do you
mean by define toMainForm as well? Do you mean, create another
instance of toMainForm? For what purpose? And that will work for me?
Can you be more specific?

Thanks for your time and thanks in advance!
 
P

Pedro

Hi all;

Finally got it!!

Honestly, i gave up from MDI's - the reported issues in previows posts
remains, and apparently without solution (hope it's not a VS.NET 2003
1.1 bug but if so, i hope MS's VS.NET 2005 has given the rigth
solution to this).

I didn't mentioned it, but in the first place, i've tryed to work with
SDI's and because of a strange behavior - thougth it would be caused
precisely by SDI's - i changed my approach and implementation.

The strange behavior, related to event objects that never occured, was
quite a pain in the ... to workaround (really annoying but caused by
some bad code of my own, so i cannot complain, right?), but in the
end, it was worth it!

Now i simply do as follow;

Dim loPreview As frmLstPreview = New frmLstPreview
If Not toMainForm Is Nothing Then
toMainForm.AddOwnedForm(loPreview)
End If
loPreview.Show()

and just like that, i can iteract with my toMainForm objects and with
loPreview and so long "strange behavior"!

I wonder why MDI's, intended to implement interaction, can't do this?
Maybe it's something that i'm missing, but it doesn't matter anymore!

Thanks for your time and patient!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top