The error is coming from the picturebox call, not the elevator call. From: "Lightning" oktellme at earthlink.net I'm trying yousendit for the first time. This url should give you my code. If it doesn't, let me know, I will send it to you direct. http://www.yousendit.com/transfer.php?action=download&ufid=0708411E00D20A11 The code I am asking about is in form1 near bottom. It uses a method in elevator.cs. This is a practice piece. I've got an eleven floor elevator (0-10), and an image for each floor. This routine tests to see if the floor has an elevator car on it. If it does, it inserts a picture of an elevator. If it doesn't, it uses a picture of elevator cables. I am doing this as part of a portfolio, so I want it to LOOK cute, too! thanks Lasuras ----- Original Message ----- From: To: Cc: Sent: Tuesday, August 15, 2006 12:21 PM Subject: Re: [thelist] question concerning c# dynamically changing whatisinapicturebox > Laura > > [..] > >> >> pbxFloor0.BackgroundImage = >> >> myElevator.CloseElevatorDoor(i).ToString(); >> >> >> >> where pbxFloor0 is a picture box, and >> >> myElevator.CloseElevatorDoor(i).ToString() returns an image name. >> >> >> >> The error message says "BackgroundImage denotes a property where a >> >> method was expected". >> >> >> >> I tried to hardcode the image name, and got the sqame message. >> >> >> >> What am I doing wrong? > > If you get the same error when you hardcode the value, you know that bad > input is not causing the problem. Taking a look at the error message, it > seemss to tell you two things: you are using BackgroundImage as a > property, and BackgroundImage is actually a method. This may mean that > either the declaration of BackgroundImage is incorrect, or your usage of > it is incorrect. Did you produce the custom class yourself? If so, take > a look at your declaration of BackgroundImage. If not, look at the > documentation for the usage of BackgroundImage. Post the code, if you're > in any doubt. > > [..] > > -- > Chris Marsh > Software Developer > t: +44 20 8246 4804 x828 > f: +44 20 8246 4808 > e: chris at globet.com > w: http://www.globet.com/ > > Any opinions expressed in this email are those of the individual and not > necessarily the Company. This message is intended for the use of the > individual or entity to which it is addressed and may contain > information that is confidential and privileged and exempt from > disclosure under applicable law. If the reader of this message is not > the intended recipient, you are hereby notified that any dissemination, > distribution, or copying of this communication is strictly prohibited. > If you have received this communication in error, please contact the > sender immediately and delete it from your system. > -- > > * * Please support the community that supports you. * * > http://evolt.org/help_support_evolt/ > > For unsubscribe and other options, including the Tip Harvester > and archives of thelist go to: http://lists.evolt.org > Workers of the Web, evolt ! -- * * Please support the community that supports you. * * http://evolt.org/help_support_evolt/ For unsubscribe and other options, including the Tip Harvester and archives of thelist go to: http://lists.evolt.org Workers of the Web, evolt !