[thelist] question concerning c# dynamically changing what is in a picturebox

Peter Brunone (EasyListBox.com) peter at easylistbox.com
Mon Aug 14 20:38:28 CDT 2006


		Hi Laura,

   The problem is quite simple once you realize what's going on.  In C-based languages (this includes Java and Javascript), you indicate an element of an array or collection with brackets rather than with parentheses.

pbxFloor0.BackgroundImage = myElevator.CloseElevatorDoor[i].ToString(); 

   This still bites me every once in a while.

Cheers,

Peter

				From: "Lightning" oktellme at earthlink.net

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?

I looked thru the methods and found
pbxFloor0.BackgroundImage.GetThumbnailImage, but I don't understand what it 
says about the abort delegat.

thanks for any help.

Laura



More information about the thelist mailing list