SelectedToolboxItem Property
SelectedToolboxItem
Returns currently selected toolbox item.
Declaration
public ToolboxItem SelectedToolboxItem { get; }
Property Value
Type | Description |
---|---|
ToolboxItem |
Implements
Remarks
The SelectedToolboxItem is a read-only property, it's changed when a user selects an item on the toolbox.
Examples
Here is how to use a SelectedToolboxItem in the C# code:
using System;
using System.Windows;
using Alternet.FormDesigner.Wpf;
using Alternet.FormDesigner.Wpf.Toolbox;
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;
}
private void Button_Click(object sender, RoutedEventArgs e)
{
MessageBox.Show(toolbox.SelectedToolboxItem.DisplayName);
}
}
Here is how to use a SelectedToolboxItem in the Visual Basic code:
Imports System
Imports System.Windows
Imports Alternet.FormDesigner.Wpf
Imports Alternet.FormDesigner.Wpf.Toolbox
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
End Sub
Private Sub Button_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
MessageBox.Show(toolbox.SelectedToolboxItem.DisplayName)
End Sub
End Class