Calling Other Forms


Author
Message
Mike Thomas
Mike Thomas
StrataFrame Beginner (32 reputation)StrataFrame Beginner (32 reputation)StrataFrame Beginner (32 reputation)StrataFrame Beginner (32 reputation)StrataFrame Beginner (32 reputation)StrataFrame Beginner (32 reputation)StrataFrame Beginner (32 reputation)StrataFrame Beginner (32 reputation)StrataFrame Beginner (32 reputation)
Group: Forum Members
Posts: 26, Visits: 82
I saw this code snippet in the CRM Sample.  Is the recommended method for calling other forms?  can you explain the activator object?

Private Sub LaunchForm(ByVal FormType As System.Type)

'-- Establish Locals

Dim loForm As Form

'-- Create the form

loForm = CType(Activator.CreateInstance(FormType), Form)

'-- Set the MDI parent

loForm.MdiParent = Me

'-- Show the form

loForm.Show()

End Sub

#End Region

#Region " Handled Events "

''' <summary>

''' Launch the customers maintenance form

''' </summary>

'''<param name="sender"></param>

''' <param name="e"></param>

''' <remarks></remarks>

Private Sub cmdCustomers_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdCustomers.Click

Me.LaunchForm(GetType(CustomerMaintenance))

End Sub


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search