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.