Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Proper way to evaluate
Message
From
01/01/2005 21:16:34
 
 
To
01/01/2005 19:09:09
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
00973604
Message ID:
00973673
Views:
15
>One, I bet your PictureBoxes haven't actually been instantiated yet. This might cause problems because this code assumes that they've already been instantiated.
>
>Two, You need to cast the result of the GetField stuff to a PictureBox. I'm sorry, I don't remember the VB syntax for casting.

This is the closest thing I can get:
                Dim loType As Type = GetType(PictureBox)
                Dim loFieldInfo As FieldInfo = loType.GetType.GetField("WebServerImage" + lnCounter.ToString().Trim(), _
                 BindingFlags.Instance Or BindingFlags.NonPublic)
                Dim loPictureBox As PictureBox
                loPictureBox = loFieldInfo.GetValue(loType)
                loPictureBox.Image = ImageList.Images(0)
It is probably close to be workable but the line:
                loPictureBox = loFieldInfo.GetValue(loType)
is returning an error at run time. It is also the same error as before. The reference is not set.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform