Results 1 to 2 of 2

Thread: Changing background image

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2004
    Posts
    42

    Changing background image

    How do I change the background image of a form on a button click? I see that the original background image is set by

    Me.BackgroundImage = CType(resources.GetObject("$this.BackgroundImage"), System.Drawing.Bitmap)

    so how do I tell it to use a different image, I have no idea what that all means... I have an image called bgimage.jpg as the background at the moment, but at certain times I wans to use an image called bgimage2.jpg which is stored in an images folder within the project folder...

    Thanks.

  2. #2
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367
    VB Code:
    1. Me.BackgroundImage = System.Drawing.Image.FromFile(Application.StartupPath & "\Images\bgimage2.jpg")

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width