Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Proper way to evaluate
Message
From
01/01/2005 17:25:05
 
 
To
01/01/2005 13:07:50
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
00973604
Message ID:
00973658
Views:
18
Sorry, Michel ... I probably should've pointed you to Rick's other reference to this kind of stuff on his WebBlog. It's at:

http://west-wind.com/weblog/posts/256.aspx

Basically, you'd need to do something like this (I don't know what your controls are that contain the .Image property, so I'm just calling them object here. You can substitute the correct control:
        For lnCounter = 1 To lnNumberOfServer
            MyObject = (object)this.GetType().GetField(MyImageName+lnCounter.ToString().Trim(), BindingFlags.Instance|BindingFlags.NonPublic).GetValue(this);
            MyObject.Image = Image.FromFile(lcStartupDirectory + "..\Images\Green.gif")
        Next
~~Bonnie




>>I'm losing track of your posts. You posted a question an hour earlier about images. You answered that question yourself a half hour after that. This post here seems similar to that answering post, yet it was made 15 minutes after it. I guess I'm just getting confused as to whether you've already answered your question.
>>
>>If you're asking about how to execute dynamic code (which, from your other post, I didn't think you needed to do), then check out Rick's white paper on the subject:
>>
>>http://www.west-wind.com/presentations/DynamicCode/DynamicCode.htm
>
>No, this one was not resolved. I just can't see with that article and the use of Reflection how to accomplish that dynamic reference I need.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform