dashboard-401640-get-started-build-winforms-dashboard-applications-create-a-winforms-dashboard-designer-in-net.md
This tutorial describes how to create a WinForms application with the Dashboard Designer in .NET.
You can create a new .NET project in the console window or use Visual Studio’s template.
Open the console window and follow the steps below.
Create and open a new folder. The folder name is the project name.
mkdir NewWinFormsApp
cd NewWinFormsApp
Create a WinForms project:
dotnet new winforms
Create a solution file:
dotnet new sln
Add the created .NET project to this solution:
dotnet sln add NewWinFormsApp.csproj
Open the created solution in Visual Studio.
In Visual Studio, create a new project and select Windows Forms App on the start page as the project template.
Note
Do not select the Windows Forms App (.NET Framework) template.
In the next dialog window, select the target framework.
Select Manage NuGet Packages in the invoked context menu to invoke the NuGet Package Manager.
Register the DevExpress NuGet feed as a package source and select it in the drop-down menu.
Install the DevExpress.Win.Dashboard.Design package ( DevExpress.Win.Dashboard for projects that target .NET).
The installed libraries are added to the project after installation is completed.
You can create the Dashboard Designer at design time or in code when you reference the DevExpress.Win.Dashboard.Design package in your project. For projects that reference the DevExpress.Win.Dashboard package, the Dashboard Designer can only be created in code.
Drag the DashboardDesigner control from the DX.22.1: Data & Analytics Toolbox tab and drop it onto the main form.
Click the control’s smart tag and select Dock in parent container in the invoked actions list to allow the Dashboard Designer to fill the form.
To create a Ribbon UI in the Visual Studio Designer, click Create Ribbon :
To create the Dashboard Designer at runtime, add the following code in a Form1.cs file:
using System.Windows.Forms;
using DevExpress.DashboardWin;
//...
DashboardDesigner designer = new DashboardDesigner();
this.Controls.Add(designer);
designer.Dock = DockStyle.Fill;
designer.CreateRibbon();
Imports System.Windows.Forms
Imports DevExpress.DashboardWin
'...
Private designer As New DashboardDesigner()
Me.Controls.Add(designer)
designer.Dock = DockStyle.Fill
designer.CreateRibbon()
Run the application and configure your dashboard in the Designer. Follow this step-by-step tutorial for more information: How to create a dashboard in the WinForms Designer.
You can use the DashboardDesigner.LoadDashboard method to load an existing dashboard in code.