locked
Setting Button background Image RRS feed

  • Question

  • I have been using this to se the Button Background Image.

    Me.Save_View_Button.Image = Image.FromFile("M:\My Image Folder\MultiColum.png")

    This sets the Image from a Folder.  

    I need to make use of Images in the Resources Folder.  

    Can someone pleas help me on the correct way.  

    Tuesday, September 5, 2017 12:49 PM

Answers

  • I have been using this to se the Button Background Image.

    Me.Save_View_Button.Image = Image.FromFile("M:\My Image Folder\MultiColum.png")

    This sets the Image from a Folder.  

    I need to make use of Images in the Resources Folder.  

    Can someone pleas help me on the correct way.  

    It would be something like this:

    Save_View_Button.Image = My.Resources.MultiColum

    As you're typing in the image name, IntelliSense will show you the name that it's stored as.


    "A problem well stated is a problem half solved.” - Charles F. Kettering


    Tuesday, September 5, 2017 12:59 PM

All replies

  • Once you have the image set via My resources under project properties. Select the button, select Image, from the dialog which appears, select the image


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    • Proposed as answer by laurens vdb Tuesday, September 5, 2017 2:33 PM
    Tuesday, September 5, 2017 12:58 PM
  • I have been using this to se the Button Background Image.

    Me.Save_View_Button.Image = Image.FromFile("M:\My Image Folder\MultiColum.png")

    This sets the Image from a Folder.  

    I need to make use of Images in the Resources Folder.  

    Can someone pleas help me on the correct way.  

    It would be something like this:

    Save_View_Button.Image = My.Resources.MultiColum

    As you're typing in the image name, IntelliSense will show you the name that it's stored as.


    "A problem well stated is a problem half solved.” - Charles F. Kettering


    Tuesday, September 5, 2017 12:59 PM