CategoryNames Property
CategoryNames
Gets collection of Categories (Tabs) displayed by the toolbox.
Declaration
public string[] CategoryNames { get; }
Property Value
Type | Description |
---|---|
System.String[] |
Implements
Remarks
This property is used to store a list of toolbox category names.
Examples
Here is how to use a CategoryNames in the C# code:
using Alternet.FormDesigner.Wpf;
using Alternet.FormDesigner.Wpf.Toolbox;
using System;
using System.Text;
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;
System.Windows.MessageBox.Show(GetList(toolboxControl.CategoryNames));
}
private string GetList(string[] list)
{
var sb = new StringBuilder();
int i = 0;
foreach (var elem in list)
{
sb.Append(elem.ToString());
i++;
if (i < list.Length)
sb.Append(", ");
}
return sb.ToString();
}
}
Here is how to use a CategoryNames in the Visual Basic code:
Imports Alternet.FormDesigner.Wpf
Imports Alternet.FormDesigner.Wpf.Toolbox
Imports System
Imports System.Text
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
Windows.MessageBox.Show(GetList(toolboxControl.CategoryNames))
End Sub
Private Function GetList(ByVal list As String()) As String
Dim sb = New StringBuilder()
Dim i = 0
For Each elem In list
sb.Append(elem.ToString())
i += 1
If i < list.Length Then sb.Append(", ")
Next
Return sb.ToString()
End Function
End Class