Skip to content
Robin edited this page Jan 5, 2016 · 19 revisions

Getting started

To begin using DarkUI within a WinForms project simply reference it within Visual Studio.

References

DarkUI consists of the following namespaces. Reference these within the files you'd like to use the various controls and components.

using DarkUI.Collections;
using DarkUI.Config;
using DarkUI.Controls;
using DarkUI.Docking;
using DarkUI.Forms;
using DarkUI.Renderers;
using DarkUI.Win32;

Using DarkUI controls

Once the DarkUI library is referenced your toolbox should have a section called 'DarkUI Components'. Within this section you'll find all of the controls and components the library offers.

Toolbox

If you don't see this section you might need to select them manually. To do this right-click anywhere within the Tools window and select 'Choose Items...'

Choose items

On the 'Choose Toolbox Items' form click the 'Browse...' button and select the 'DarkUI.dll' file.

Browse

This should add all of the DarkUI components to the list view. Accept these changes to make them show up in the toolbox.

Components

As with any WinForms control library just drag these on to a form or user control and you'll be able to use the visual designer to modify the look and feel of your application.

Creating a DarkForm

DarkForm inherits from Form so can be a drop-in replacement for any references you have to this within your project.

If you modify the blank Form1 class created with a fresh WinForms project you can instantly get started with a dark-themed form.

public partial class Form1 : DarkForm
{
    public Form1()
    {
        InitializeComponent();
    }
}

You should immediately see your changes in the designer.

New DarkForm

Using the DarkDialog super class

DarkDialog is a DarkForm with additional functionality which simplifies creating dialog forms.

As before with the DarkForm example, simply change any instance of Form to DarkDialog to use this class.

public partial class Form1 : DarkDialog
{
    public Form1()
    {
        InitializeComponent();
    }
}

It'll look very similar to a DarkForm except you'll now have an 'Ok' button at the bottom.

DarkDialog

This is the dialog footer, and can be changed to show a different combination of standard dialog action buttons.

Currently, the following combinations are possible.

  • Ok
  • Close
  • OkCancel
  • YesNo
  • YesNoCancel
  • AbortRetryIgnore
  • RetryCancel

You can define which buttons are shown by the dialog by modifying the DialogButtons property.

Dialog buttons

Clone this wiki locally