OK this is what i've got:
I have a MdiParent with a PictureBox in it and when I call a form from the main menu it shows up behing the picture box. How can i fix this?
Thanks in advance
Brad Nichols
Printable View
OK this is what i've got:
I have a MdiParent with a PictureBox in it and when I call a form from the main menu it shows up behing the picture box. How can i fix this?
Thanks in advance
Brad Nichols
have you tried
PictureBox1.SendToBack()
?
That doesn't work on a MDIParent.
Any other suggestions?
Thanks
Brad Nichols
Hi.
You can't do that. Object placed directly on an MDIParent will always be in front of the MDIChildren.
Why do you want to do this anyway?
If you just want to display an image, you would have to find the MDIClient area of the main form. Then you can add a handler to the paint event, and draw the image yourself.
VB Code:
'Put this in form load Dim o As Object For Each o in Me.Controls If TypeOf (o) Is MDIClient Then AddHandler o.Paint,AddressOf MyPaintEvent Exit For End If Next 'Create a sub like this Private Sub MyPaintEvent(Byval sender As Object, Byval e as PaintEventArgs) e.Graphics.DrawImage(MyImage,0,0) End Sub
I hope this helps you. If not, sorry.
The reason for doing this is that I am writing a program for a company and the MDIParent is what is going to be shown most of the time. So I need to find a way that I can place objects on the MDIParent and the child forms display in front of it.
Any help on this would be GREATLY appreciated.
Brad Nichols
Hi.
I'm really sorry, but I just don't believe that can be done. At least not without some heavy API coding.:cry:
I'm sorry I can't help you more.
Good Luck on your quest.
Please post the result, should you find it.:wave: