wpf-devexpress-dot-xpf-dot-reports-dot-userdesigner-dot-reportdesigner-dot-registercontrol-1.md
Registers a custom control in the Report Designer and adds it to the Toolbox.
Namespace : DevExpress.Xpf.Reports.UserDesigner
Assembly : DevExpress.Xpf.ReportDesigner.v25.2.dll
NuGet Package : DevExpress.Wpf.Reporting
public static void RegisterControl<T>()
where T : XRControl, new()
Public Shared Sub RegisterControl(Of T As {XRControl, New})
| Name | Description |
|---|---|
| T |
The control’s type.
|
The following example registers a custom control in the Report Designer. This control appears in the Toolbox.
using DevExpress.Xpf.Reports.UserDesigner;
using DevExpress.XtraReports.UI;
using System.Windows;
//...
public class ProgressBar : XRControl { /* ... */ }
//...
public partial class MainWindow : Window {
public MainWindow() {
InitializeComponent();
ReportDesigner.RegisterControl<ProgressBar>();
}
private void Window_Loaded(object sender, RoutedEventArgs e) {
reportDesigner.OpenDocument(new XtraReport());
}
}
Imports DevExpress.Xpf.Reports.UserDesigner
Imports DevExpress.XtraReports.UI
Imports System.Windows
'...
Public Class ProgressBar ' ...
Inherits XRControl
End Class
'...
Partial Public Class MainWindow
Inherits Window
Public Sub New()
InitializeComponent()
ReportDesigner.RegisterControl(Of ProgressBar)()
End Sub
Private Sub Window_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
reportDesigner.OpenDocument(New XtraReport())
End Sub
End Class
A custom control inherits an icon from a base class. If the base class does not have an icon (e.g., XRControl ), the control inherits the default icon (a gear).
You can change the default icon. Use one of the following techniques:
RegisterControl<T>() method to set an icon from an assembly.Tip
To unregister a control and remove it from the Toolbox , use the UnregisterControl<T>() method.
See Also