Solved

Backgroundpicture in MDI-parent

Posted on 1999-01-05
9
316 Views
Last Modified: 2012-06-27
Hello...

How to get a backgroundpicture in MDI-form that resizes when i change size on the form.
If i put a picturebox with a image on the picturebox cover my MDI-Childs.
How to send the picturebox to the back ?
Any other solutions ??
Anyone having a idea ???

/Janne Sweden

This is my code:

Private Sub MDIForm_Resize()
On Error Resume Next
    pic(0).Align = 1
    pic(0).Height = Me.Height
    img.Left = 0: img.Top = 0
    img.Height = pic(0).Height: img.Width = pic(0).Width
End Sub
0
Comment
Question by:jannea
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +2
9 Comments
 

Expert Comment

by:sulli
ID: 1454100
Is there anything in the back to move to the front. If so, then you could achieve this via the zorder. Else you could play around with the picturebox's visibility property.
0
 
LVL 2

Expert Comment

by:trillo
ID: 1454101
If I remember well, I think the MDIForm has an "image" or "picture" property where you can set a background picture for your MDI form.
If your picture is a Metafile it will be resized automatically, f it is a bitmap, maybe not..
As I said before....that's what I remember, it can be False, I haven't VB installed and can't test it... anyway .....

Trillo
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1454102
You can assign the picture property of the mdiform with another (invisible) picture
mdiform1.picture = picture1
0
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
LVL 1

Author Comment

by:jannea
ID: 1454103
Hello, ant thanks for comments...

--------------------------------------------
sulli,

Sorry, the zorder dosen´t effect it. The picturebox is still in front of my MDI-Childs.
If the picturebox's visibility property = False I can´t see it ?!.
--------------------------------------------
trilloDate,

It´s true with the metafile, it will be resized automatically. But how to convert my bmp to wmf or emf to use it like this.
--------------------------------------------
MirkwoodDate,

But i still have to have a visible picturebox. And the problem is that this visible one will stay on top and cover my MDI-Childs.
--------------------------------------------

/Janne
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1454104
Set visible to false for the picturebox
0
 

Accepted Solution

by:
DPickering earned 50 total points
ID: 1454105
Goto : http://www.vb-helper.com/HowToInt.htm  (excellent site!!)

From this site you can download hundreds of tips and sample applications in one zip file. Lots of good stuff there :)

There is an entry in the list called:
Give an MDIForm a resizing background picture (3K)

I tried it out but it didn't refresh properly when resizing, so you're probably going to have to get your hands dirty using the API to try and refresh the MDI window - because there is no Refresh property and no CLS method available. Try these APIs:
* UpdateWindow
* SetWindowLong (there's example code for this somewhere in one of the sample projects in the vb-helper web site. Good luck!)

Cheers
Dave
0
 
LVL 1

Author Comment

by:jannea
ID: 1454106
DPickering,

Thanks...

/Janne
0
 
LVL 2

Expert Comment

by:trillo
ID: 1454107
Hi...
In reply to your comment to me:
Bitmaps and Metafiles are completely different and it's very hard  to convert one into another.... As you know bitmaps save the colorvalue of individual pixels on a file, while metafiles, instead, store vectors.... You can thus resize metafiles without loosing any graphic detail, this is not the same for bitmaps... On the other hand BitMaps are useful to store high detailed graphics like your own photo... but try to imagne how to draw a photo ina MetaFile only with Vectors !!!
You can easily convert a WMF or EMF to a bitmap (Caputring the screen or something)... but converting from BMP to MetaFile is rather more difficult.... There are programs like CorelTrace (included in CorelDraw) that have the ability to vectorize bitmaps... you could try such programs..

Regards
Trillo
0
 
LVL 1

Author Comment

by:jannea
ID: 1454108
trillo,

Thanks for your comment. But the answer I did get was OK for me. Now the user can change the backgroundpicture more easy, coz of bmp is a more common format for pictures you create you self instead of wmf or emf.

Janne
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
to transfer string from C lanaguage to VBA 4 78
Automatic Email Reminder 4 77
VBA - If Bookmark = "XXBOOKMARKXX" then 15 51
checkbox to hide entire section 10 63
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question