[thelist] question concerning c# dynamically changing what isina picturebox

Peter Brunone (EasyListBox.com) peter at easylistbox.com
Tue Aug 15 11:01:17 CDT 2006


		Okay, now I'm confused.  There's no index being passed to the picturebox object.

				From: "Lightning" oktellme at earthlink.net

A custom class.

It uses int i to evaluate which picture to use, then returns the name of the 
gif .
Laura

----- Original Message ----- 
From: "Peter Brunone (EasyListBox.com)" 
>
> 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?
>
> Peter
>
> 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.
> :(
> Laura
> ----- 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
> -- 
>
> * * 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 ! 





More information about the thelist mailing list