Results 1 to 5 of 5

Thread: [Resolved] Weird Resource File Error

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member neef's Avatar
    Join Date
    Dec 2001
    Location
    Boston
    Posts
    311

    [Resolved] Weird Resource File Error

    Some of the images I have in my resource file can't be used programmatically. By that I mean I get an error with this simple line of code where pbField is a picture box and TFFieldTurf is a jpeg file:

    pbField.BackgroundImage = My.Resources.TFFieldTurf

    The error I receive is:

    Error 8 'TFFieldTurf1' is a type in 'Resources' and cannot be used as an expression.

    How can an actual file be considered a type not an object? Some of my other pics get the same error, but others work just fine. It has nothing to do whether they are jpegs, pngs, or tifs either. If I use the designer to set the background property I get no errors. Only when I write my own code.

    What am I missing here?

    Thanks in advance.
    Last edited by neef; Feb 26th, 2018 at 07:59 PM.
    Intermediate Level Programmer Extraordinaire

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