FormDesigner Property
FormDesigner
Gets or sets IFormDesignerControl
bound to this toolbox.
Declaration
public IFormDesignerControl FormDesigner { get; set; }
Property Value
Type | Description |
---|---|
IFormDesignerControl |
Remarks
You can associate the Form designer with the ToolboxControl object by setting FormDesigner property. This allows users to place components onto the designer's surface, by dragging them from the toolbox.
Examples
Here is how to use a FormDesigner in the C# code:
using Alternet.FormDesigner.Wpf;
using Alternet.FormDesigner.Wpf.Toolbox;
using System;
public partial class MainWindow : Window
{
private void Window_Loaded(object sender, RoutedEventArgs e)
{
var formDesigner = new FormDesignerControl();
formDesigner.AutoSaveToSource = false;
var toolboxControl = new ToolboxControl();
toolboxControl.FormDesigner = formDesigner;
toolboxControl.FormDesignerChanged += ToolboxControl_FormDesignerChanged;
}
private void ToolboxControl_FormDesignerChanged(object sender, EventArgs e)
{
System.Windows.MessageBox.Show("Designer changed");
}
}
Here is how to use a FormDesigner in the Visual Basic code:
Imports Alternet.FormDesigner.Wpf
Imports Alternet.FormDesigner.Wpf.Toolbox
Imports System
Partial Public Class MainWindow
Inherits Window
Private Sub Window_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
Dim formDesigner = New FormDesignerControl()
formDesigner.AutoSaveToSource = False
Dim toolboxControl = New ToolboxControl()
toolboxControl.FormDesigner = formDesigner
AddHandler toolboxControl.FormDesignerChanged, AddressOf ToolboxControl_FormDesignerChanged
End Sub
Private Sub ToolboxControl_FormDesignerChanged(ByVal sender As Object, ByVal e As EventArgs)
Windows.MessageBox.Show("Designer changed")
End Sub
End Class