# Step 1 of 3: Setting up the Application

## Content



In this step, you begin with creating a WPF application in Visual Studio and then adding a FlexSheet control to your application.

### In Design View

To add a FlexSheet to your WPF application in Design view, perform the following steps:

1.  Create a new WPF project in Visual Studio.
2.  Navigate to the Toolbox and locate the [C1FlexSheet](/componentone/api/wpf/online-flexsheet/dotnet-framework-api/C1.WPF.FlexSheet.4.6.2/C1.WPF.FlexGrid.C1FlexSheet.html) control icon.
3.  Double-click the [C1FlexSheet](/componentone/api/wpf/online-flexsheet/dotnet-framework-api/C1.WPF.FlexSheet.4.6.2/C1.WPF.FlexGrid.C1FlexSheet.html) icon to add the control to the MainWindow. The control looks like the following:
    
    ![FlexSheet control added to design view](https://cdn.mescius.io/document-site-files/images/b3208bf5-7808-4aa7-9bcc-2bc34f627220/images/quickstart/flexsheet-designview.png)
    

### In Code

To add a FlexSheet to your WPF application in Code view, perform the following steps:

1.  Set the Name property of the Grid in XAML so that the control has a unique identifier to call in code. In our case, Name property of the Grid control is set to Parent, as shown in the following code:
    
    ```xml
    <Grid Name="Parent">
    </Grid>
    ```
    
2.  Add the following namespaces in Code view:
    
    **vbnet**
    
    ```vbnet
    Imports C1.WPF
    Imports C1.WPF.FlexGrid
    ```
    
    **csharp**
    
    ```csharp
    using C1.WPF;
    using C1.WPF.FlexGrid;
    ```
    
3.  Add the following lines of code beneath the **InitializeComponent()** method to add the FlexSheet control:
    
    **vbnet**
    
    ```vbnet
    Dim flex = New C1FlexSheet()
    Parent.Children.Add(flex)
    ```
    
    **csharp**
    
    ```csharp
    var flex = new C1FlexSheet();
    Parent.Children.Add(flex);
    ```