Krypton Docking Getting Started

Intro

Krypton Suite is an awesome free controls library for Winforms. It’s presently being maintained/expanded by some good souls. You can check it out here: GitHub

Unfortunately, the documentation is somewhat lacking. Particularly for the Docking feature. Thus, I thought I’d keep a record of my discoveries whilst figuring this library out.

Getting started

Install the relevant Krypton Libraries from nuget. Start with a basic windows form. Then add KryptonManager and DockingManager to the form. Add a KryptonPanel to the form and a child KryptonDockableWorkspace.

To instantiate docking, do the following:

Then, to add dockable windows (they are called “Pages” in Krypton), include the following method:

You can add a window via various methods, all under DockingManager.Addxxx. The two covered here are to ‘DockSpace’ and to ‘Workspace’ The former is traditional tool window docking and the latter is akin to multi-instance document/workpiece docking (think code in Visual Studio or Images in Photoshop). You basically just send a control to the above method. These controls can be UserControls – the best way to achieve different views:

Focussing a Page

This was a bit of a tricky one. Basically, you need to find the parent Cell of the Page and then set its SelectedPage to the Page you want focussed. A method to assist:

Useful Members

Member Function Notes
KryptonDockableWorkspace.ActivePageChanged Event fired when Page is changed EventArgs provide old and new Page

 

Glossary

Krypton Term Function Notes
Page An individual dockable window
Cell That in which numerous Pages are stacked (e.g. tabbed documents or tool windows)
About stigzler 48 Articles
Chief crook and wattle bosher.

Be the first to comment

Leave a Reply

Your email address will not be published.


*