Print Search Rate
    
   04-16-2004, 11:50 AM
HOWTO: How Can I Host a Form in a Tool Window at Run Time?
Attachment: SUIHostingForms.zip

After adding the form (HostForm) to the project and the tool window (twHostWindow) in which you wish to host the form, add the following code in the Form1_Load event:

[Visual Basic]
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
   Dim f2 As New HostForm()
   f2.Show()
   Me.twHostWindow.HostedControl = f2
End Sub

[C#]
private void Form1_Load(object sender, System.EventArgs e)
{
   Form2 f2 = new HostForm();
   f2.Show();
   this.twHostWindow.HostedControl = f2;
}

For complete step-by-step instructions for hosting a Windows Form inside of a tool window, see the following walkthrough in the SharpUI for .NET User Guide: Using Tool Windows.


Jennifer-DD
GrapeCity » Frequently Aske... » SharpUI for .NE... » HOWTO: How Can I Host a Form in a Tool Window at Run Time?
Privacy Policy | Copyright © 1997-2012 — GrapeCity, inc.
All trademarks mentioned are the property of their respective owners.