Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Proper way to evaluate
Message
De
01/01/2005 21:16:34
 
 
À
01/01/2005 19:09:09
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
00973604
Message ID:
00973673
Vues:
14
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform