Home Forums WinForms controls Other WinForms controls Newbye question

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #18040 |

    Hi, i’m trying to change image of a outlookshortcutbar item at runtime but doesn’t work. If i load the same image at design time it work fine.

    That’s my code:
    Dim image As Image
    image.FromFile(“c:\xxx\xxx.png”)
    Me.mnuBar.Items(0).Items(0).Image = image

    When i lunch the application the icon disappear.
    Thanks.

    Imported from legacy forums. Posted by evanlucker (had 2099 views)

    User (Old forums)
    Member
    Post count: 23064

    The reason your picture is not appearing is because your code is invalid. You are retrieving the image from a file, but then you are not assigning it to the image variable. Try this instead for your code:

    Dim image As Image
    image = image.FromFile(“c:\xxx\xxx.png”)
    Me.mnuBar.Items(0).Items(0).Image = image

    Imported from legacy forums. Posted by paulplatter (had 3029 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.