Skip to main content
A newer version of this page is available. .

Getting Started

  • 2 minutes to read

Important

You require a license to the DevExpress Office File API or DevExpress Universal Subscription to use these examples in production code. Refer to the DevExpress Subscription page for pricing information.

To get started with the Unit Conversion API, perform the following steps.

  1. Start Microsoft Visual Studio and create a new Windows Forms Application project by selecting FILE | New | Project… in the main menu. In the invoked New Project window, select Windows Forms Application, specify the name of the project and click OK.

    Spreadsheet_CreateNewProject

  2. On the Project menu, choose Add Reference. Alternatively, you can right-click your project in Solution Explorer and then click Add Reference. The Reference Manager dialog window is displayed. Select the DevExpress.Docs.v18.2.dll assembly and then click OK.
  3. Drag a Button control from the Toolbox and drop it on the form.
  4. Double click the button. In the button click handler, insert the code below.

    using DevExpress.UnitConversion;
    //...
    // The height is 5'4".
    QuantityValue<Distance> height = (5.0).Feet() + (4.0).Inches();
    string s = String.Format("The height is {0} ells or {1} meters.",
        height.ToElls().Value.ToString("g3"), height.ToMeters().Value.ToString("g3"));
    MessageBox.Show(s);
    
  5. Run the project and execute the method. This will result in the display of the following message box.

    units_getstarted

See Also