I have a flowlayoutpanel, and i am dynamically adding empty pictureboxes to it. Then do a bunch of things. Then how do i add image to a certain pictureboxes in the panel? can i refer to the picturebox by name?
DirectCast will only work if the object is the specific type that you're casting as. CType will also perform conversions in cases where it's supported. For instance, this will work:
VB.NET:
Dim o As Object = "100"
Dim n As Integer = CType(o, Integer)
while this will not:
VB.NET:
Dim o As Object = "100"
Dim n As Integer = DirectCast(o, Integer)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.