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

Peter Brunone (EasyListBox.com) peter at easylistbox.com
Mon Aug 14 21:37:12 CDT 2006

		Oh... guess I should have read the actual error message instead of just the part that looked familiar.

Is this the native (Windows Forms) picturebox control, or a custom class?


				From: "Lightning" oktellme at earthlink.net

Sorry- no joy.

I should have mentioned that CloseElevatorDoor is a method, and when I 
replace with brackets, I get a message it is looking for parens.
----- Original Message ----- 
From: "Peter Brunone (EasyListBox.com)" 
> 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