Results 1 to 9 of 9

Thread: Need help on setting the Backround Image for the form......[Resolved]

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2005
    Location
    USA Washington
    Posts
    191

    Resolved Need help on setting the Backround Image for the form......[Resolved]

    I can't figure out how to change the form backround image property when a label is clicked. I just have the file in My Pictures. Can anyone help me??
    Last edited by Hiroshi; May 11th, 2005 at 05:24 PM.

  2. #2
    Fanatic Member
    Join Date
    Oct 2003
    Posts
    1,005

    Re: Need help on setting the Backround Image for the form......

    Try...

    BackgroundImage.Image = BackgroundImage.Image.FromFile("c:\myfile.bmp")

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2005
    Location
    USA Washington
    Posts
    191

    Re: Need help on setting the Backround Image for the form......

    It says " Image is not a member of 'system.drawing.image' ".

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    May 2005
    Location
    USA Washington
    Posts
    191

    Re: Need help on setting the Backround Image for the form......

    I've got it! You can't type Image, you have to type just
    BackroundImage = BackroundImage.fromfile("blah.bmp").
    Thank you for your help,

  5. #5
    Fanatic Member
    Join Date
    Oct 2003
    Posts
    1,005

    Re: Need help on setting the Backround Image for the form......

    Make sure you add the System.Drawing to the reference of your solution.

    Another way if image is in your app folder (or bin folder when debugging)

    VB Code:
    1. Me.BackgroundImage = Me.BackgroundImage.FromFile(Application.StartupPath & "\image.gif")

  6. #6
    Fanatic Member
    Join Date
    Oct 2003
    Posts
    1,005

    Re: Need help on setting the Backround Image for the form......

    Quote Originally Posted by Hiroshi
    I've got it! You can't type Image, you have to type just
    BackroundImage = BackroundImage.fromfile("blah.bmp").
    Thank you for your help,
    That was my goof up on the "image" syntx. I was typing by memory and ... well my memory goofed.

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    May 2005
    Location
    USA Washington
    Posts
    191

    Re: Need help on setting the Backround Image for the form......[Resolved]

    What do you mean, Like add the bmp file to the solution?
    And how do you add images to your app folder?

  8. #8
    Fanatic Member
    Join Date
    Oct 2003
    Posts
    1,005

    Re: Need help on setting the Backround Image for the form......[Resolved]

    I'm referring to your images being on your hard drive in the same folder as your application.exe.

    When debugging, VS.NET uses the "bin" folder to put your app.exe. If you use the (Application.StartupPath & "\image.bmp") syntx that means that it gets the image from the same location as your exe application.

    Then put your images in the bin folder for testing

    If you used VB6 that old syntx was app.path... it is now Application.StartupPath

    Understand?

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    May 2005
    Location
    USA Washington
    Posts
    191

    Re: Need help on setting the Backround Image for the form......[Resolved]

    yeah thanks

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