Easiest way to Late Bind a LABEL Control Obj w/Option Strict On, Using VB 2008 RRS feed

  • Question

  • I have tried using System.Reflection and Passing vars to Sub, but still get "Option Strict On Doesnt allow Late Binding"




    Sub DisplayAVATARtext(ByVal ADisplayControlName As String, ByVal FontName As   String, ByVal FontSize As Integer, ByVal DispCtrlLocationHorzX As Integer, ByVal DispCtrlLocationVertY As Integer, ByVal DisplayText As String, ByVal DispWaitTime_msec As Integer






    BIG_Font As New

    Font(FontName, FontSize, FontStyle.Bold)




    a As Assembly =


    a = Assembly.LoadFile(



    Dim DisplayControl As

    Type = a.GetType(ADisplayControlName)


    Dim objADisplayControl As Object

    = Activator.CreateInstance(DisplayControl)


    objADisplayControl.font = BIG_Font

    End Sub



    Everything Runs OK till trying to Assign the Font, DisplayControl never gets Assigned !!!

    Please Help...What am I doing Wrong ???? A BEtter Way ???????

    Wednesday, August 24, 2011 11:24 PM


All replies