Background image for main form


Author
Message
Ross L. Rooker, Sr.
Ross L. Rooker, Sr.
StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)
Group: Forum Members
Posts: 153, Visits: 462
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?
Ross L. Rooker, Sr.
Ross L. Rooker, Sr.
StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)
Group: Forum Members
Posts: 153, Visits: 462
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.
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.3K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
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.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search