Can you have your own back ground in an MDI parent form or does it have to be that dull gray color? I got a cool background image i want to tile in the background is there anyway to get around that dull background that is the default(and atleast for me unchangeable) background....Thanks Guys!
You may be able to use the graphics object of the mdi parent form to paint the image on the background. You would probably do this in the OnPaint event.
This knowledge base article describes how to set the background color for the MDI application area. It also works for a background image, though that's not specified in the article.
Originally posted by Athley You can also set the BackGroundImage property at design time.
Actually I tried that and it doesn't work. Both the BackColor and BackgroundImage properties of form with IsMdiContainer set to true are ignored in favor of the system color.
The code in the knowledgebase article uses an odd casting syntax in a try...catch statement. This version is more concise and (I believe) perfectly safe:
VB Code:
Dim ctl As Control
For Each ctl In Me.Controls
If TypeOf ctl Is MdiClient Then ctl.BackColor = Me.BackColor
Next
That will use the BackColor AND BackgroundImage (if one is specified) of the form in the MDI container.
Actually I tried that and it doesn't work. Both the BackColor and BackgroundImage properties of form with IsMdiContainer set to true are ignored in favor of the system color.
Hmmmm, I have 2 applications With MDI functionality, I tried to set the Background Image of the form in both apps and I can sure se a background image. I dont see it in design time though, but runtime has to be what's intresting.
It is another story with the BackColor property though. Microsoft actually states the following "The BackColor for an MDI form will always be the default.".
.....hmmmm as a matter of fact they also state "MDI forms in Visual Basic .NET cannot display pictures." so I wonder why BackGroundImage works with my sarent forms.
Originally posted by Athley Hmmmm, I have 2 applications With MDI functionality, I tried to set the Background Image of the form in both apps and I can sure se a background image. I dont see it in design time though, but runtime has to be what's intresting.
In VB.NET? Strange.
I tried that and while it flashed the background image briefly, I could see the background image neither in design time nor in runtime until I used the trick from the knowledgebase article.