[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 204
  • Last Modified:

wallpaper for an app

How can I take a gif,jpg or bmp and use it as a wallpaper for my app.  Ild like it to stretch to the full isze of my app and allow to have buttons and control on top.  AKA just like the windows wallpaper can have icons on top of it.  any code or tips is great thanks scott
0
ocsscott
Asked:
ocsscott
1 Solution
 
vettrangerCommented:
Just set the picture property of your form to the filename of the picture you want.

Is this what you are after, or did you have something more in mind?
0
 
JuiletteCommented:
'tile an image on a form

'1) Place an image control on a form and give it a picture
'2) Set the forms AutoRedraw to False
'3) Place this code in the Form Paint Event

      Dim intX As Integer
      Dim intY As Integer

      For intX = 0 To Me.Width Step Image1.Width
                For intY = 0 To Me.Height Step Image1.Height
                    PaintPicture Image1, intX, intY
          Next intY
            Next intX
0
 
ocsscottAuthor Commented:
I do not want a tiled effect I want 1 picture expanded to fill the whole form.  Using the picture property of the form added a picture but did not expand it to the size of the form.  Im thinking just like windows wallpaper stretched to fit the screen
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
polygonCommented:
Try placing an image on your form and resize it with your window

Private Sub Form_Resize(...)
Image.Width = Form.Width
Wimage.Height = Form.Height
End Sub
0
 
ocsscottAuthor Commented:
Private Sub Form_Resize()
   frmMain.Picture.Width = frmMain.Width
   frmMain.Picture.Height = frmMain.Height
End Sub

i tried this code and it gets an error.

run time error 438.  "object does not support this property or method."


any other ideas
0
 
ocsscottAuthor Commented:
please see my last comment
0
 
Bob LearnedCommented:
The Picture property of a form does not allow for resizing.  You would have to use another control like a Picture Box or Image control that has AutoResizing properties.  

I don't understand why the answer from polygon was rejected.
0
 
ggilmanCommented:
Look at the render method for the picture object such as form1.picture.render(...). You might be able to use this in the resize event of the form to resize your picture to the form size. I have gotten it to resize the form picture but cannot seem to get the parameters just right.
0
 
ocsscottAuthor Commented:
i miss understood the answer I wanted the picture property of the form to be able to resize so all controls can go above it like true wallpaper.
0
 
ggilmanCommented:
Create an image box with the picture you want and make the image box not visible. Then use the code below. Unfortunately it flickers a little when resizing but works. You can use controls above the "wallpaper" with this method. If this isn't good enough, I'd have to agree with theLearnedOne and Polygon: You cannot make the picture property of the form change size.

Private Sub Form_Resize()
    Me.Cls
    PaintPicture Image1.Picture, 0, 0, Me.Width, Me.Height
End Sub
0
 
ocsscottAuthor Commented:
thanks that looks like I wanted.
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now