StrataFrame Forum

Background image for main form

http://forum.strataframe.net/Topic29016.aspx

By Ross L. Rooker, Sr. - 11/18/2010

I could use the background image on the main form, but it has a left panel and I want it to appear centered in the main area of the form to the right of the left panel. I used a ultraPictureBox control to fill the main area of the form to the right of the left panel. When I click on any menu option when running the main form, the form that appears is behind the ultraPictureBox. Are you aware of how to set the z-order or send to back so that this will appear behind all called forms from the menu on the main form but be visable in the background of the main form?

Basically I am using your sample of a main form with security showing the left panel. If their is not a z-order, can you think of code to do this manually from within the frmMain form?
By Ross L. Rooker, Sr. - 11/18/2010

As an fyi, when using the image as an image background on the main form, when resizing it just doesn't refresh well. As a ultraPictureBox it is perfect.
By Greg McGuffey - 11/18/2010

I'm assuming your talking about your main MDI form here.  I've found three methods that might work.

The first is to attempt manipulate the z-order, but I'm not sure this will work with child forms vs the picture control as I don't think they are of the same type. C# Winform UI Components Layer Order.

The second is to manipulate z-order directly via the Windows API using unmanaged code. See Windows Features: Z-order. This explains how Z-order works and provides a link to the BringWindowToTop method.

The third uses a managed solution to just manually draw the MDI main form's background (thus eliminating the ultraPictureBox control). This is a CodeProject article, Drawing background of MDI window using 100% managed code, including design time support.