D
diego
hi everyone,
i have a sub that opens a form given the form's name as string and
opens it using System.Reflection. How can I set the form's properties
at runtime. Here is my code.
Public Sub OpenForm(ByVal cFormName)
Dim frm As Object
Dim frmType As Type
Try
frmType =
Type.GetType(System.Reflection.Assembly.GetExecutingAssembly.GetName.Name()
& cFormName)
frm = Activator.CreateInstance(frmType)
'**********************************
' i would like to set the form's mdichild property, text, etc before i
show it. how can this be done?
'**********************************
frmType.InvokeMember("Show",
Reflection.BindingFlags.InvokeMethod, Nothing, frm, Nothing)
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
thanks in advance
diego
i have a sub that opens a form given the form's name as string and
opens it using System.Reflection. How can I set the form's properties
at runtime. Here is my code.
Public Sub OpenForm(ByVal cFormName)
Dim frm As Object
Dim frmType As Type
Try
frmType =
Type.GetType(System.Reflection.Assembly.GetExecutingAssembly.GetName.Name()
& cFormName)
frm = Activator.CreateInstance(frmType)
'**********************************
' i would like to set the form's mdichild property, text, etc before i
show it. how can this be done?
'**********************************
frmType.InvokeMember("Show",
Reflection.BindingFlags.InvokeMethod, Nothing, frm, Nothing)
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
thanks in advance
diego