Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Controls in MDI container

Status
Not open for further replies.

xezekielx

IS-IT--Management
Jun 30, 2005
93
CA
Hi! I have an MDI application and I want to put a background image (the company's logo) in the MDI container itself. The problem is that when I open a child form, it is displayed UNDER the logo instead of OVER it. I tried using the SendToBack method on the image (it's a PictureBox control) but it hides it completely. I also tried using the BringToFront method on the child form but it doesn't change anything. Any help would be much appreciated!
 
Rather than use a PictureBox, why don't you set the BackgroundImage property instead. Although this doesn't appear to show properly in design view it does when you run the program.


Hope this helps.

[vampire][bat]
 
Thanks for your answer. I tried the BackgroundImage property and it works. The only problem is that the image is repeated which is actually REALLY ugly =). Is there any way to center this background image?
 
I've just tried with a smallish image and am getting the same problem. It doesn't look too good, and as you say a PictureBox isn't very helpful. It may be worth seeing if google shows up anything, I'm sure others have come across this problem before - but I can't remember seeing anything here.

I would be interested in your outcome.

[vampire][bat]
 
I've been searching on Google for at least an hour without any success...
 
Its getting on for 9:30pm on a Saturday night (Tek-Tips time) and 2:30am Sunday here in the UK. Most of the regular posters on Tek-Tips don't post much on the weekend - so it may be worth waiting for Monday morning.

Sorry I can't be of more help.

[vampire][bat]
 
No problem mate, thanks a lot for your support!
 
Set
[tt]BackgroundImageLayOut=None[/tt]
it won't repeat the image.

________________________________________________________
Zameer Abdulla
Help to find Missing people
All cats love fish but fear to wet their paws..
 
Zameer, that property was introduced in VB 2005, and is not available in previous versions.


Hope this helps.

[vampire][bat]
 
doubt
1)Which version xezekielx does use ? 2003 or 2005?
2)Does we (TT) have a vb2005 forum?

________________________________________________________
Zameer Abdulla
Help to find Missing people
All cats love fish but fear to wet their paws..
 
thanks

________________________________________________________
Zameer Abdulla
Help to find Missing people
All cats love fish but fear to wet their paws..
 
Hey thanks for your answers but unfortunately, I own VS.NET 2003 so that BackgroundImageLayout property is not available
 
You need to draw on the forms graphics yourself not so dificult

something with
dim g as graphics
g= me.creategraphics()
g.drawimage(image)

you could do this in the onpaint and in the onresize

or make a method that is called from those two methods.

Christiaan Baes
Belgium

I just like this --> [Wiggle] [Wiggle]
 
I tried using your method but it wont draw because the form is an MDI container...
 
I just found out how!! In the onLoad event of the MDI parent form, I had to loop through all the controls to find the MDIClient control. After finding it, I just had to use the method chrissie1 proposed using the MDIClient control instead of "Me".

Thanks a bunch to everybody, you've all been of great help!
 
perhaps you could post you code for further reference or if anybody else has the same question.

Thanks in advance.

Christiaan Baes
Belgium

I just like this --> [Wiggle] [Wiggle]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top