Skip to content
Brandon edited this page Jun 21, 2019 · 12 revisions

Welcome to the CSDeskBand wiki!

Getting Started

This is a quick guide to get you started. You can decide whether to create your Deskband with Winforms or Wpf.

Usage

Deskband Options

Deskband options can be set through the Options property. These options include settings such as min/max size and context menu items (see below).

Options.MinHorizontalSize = new Size(200, 40)
Options.HorizontalSize = new Size(200, 40)
Options.MaxHorizontalHeight = 40
Options.MinVerticalSize = new Size(60, 200)
Options.VerticalSize = new Size(60, 200)
Options.MaxVerticalWidth = 60
Options.Title = "Title"
Options.ShowTitle = false
Options.IsFixed = false
Options.HeightIncrement = 1
Options.HeightCanChange = false

Context menu

You can add items to the deskband context menu through Options.ContextMenuItems. The Context menu does not work for WPF, using the WPF context menu is recommended instead.

// Clickable menu item
var action = new DeskBandMenuAction("Action!");
action.Clicked += (sender, args) => Console.WriteLine("Clicked!");
action.Enabled = true;
action.Checked = true;
Options.ContextMenuItems.Add(action);

// submenu
var sub = new DeskBandMenu("sub menu");
sub.Items.Add(new DeskBandMenuAction("subitem"));
Options.ContextMenuItems.Add(sub);

// menu item separator
Options.ContextMenuItems.Add(new DeskBandMenuSeparator());

Context menu items include CSDeskBandMenuAction CSDeskBandMenu CSDeskBandSeparator

TaskbarInfo

The TaskbarInfo property allows you to get information about the state of the size, orientation and edge of the taskbar.

Focus

You may find that if you open a window from the deskband, some keyboard shortcuts will be ignored. I believe it is because some keys are handled by the taskbar. For example pressing tab will cause the focus to switch to the next element on the taskbar. To handle this, you should explicitly capture focus through UpdateFocus().

Deskband Installation

You need to start an elevated command prompt and be able to use regasm.exe An easy way to do this is use the Developer Command Prompt for Visual Studio. Make sure that you use the correct version of regasm that matches your platform.

cd Sample.Win\bin\Debug

regasm /codebase Sample.Win.dll

The /codebase switch will add the path of the dll into the registry entry.

Alternatively, register the assemblies into the Global Assembly Cache.

gacutil -i CSDeskBand.dll
gacutil -i CSDeskBand.Win.dll
gacutil -i Sample.Win.dll
regasm Sample.Win.dll

Note that GAC installation requires the assemblies to be Strong-Named

Now right click the taskbar > Toolbars > your deskband

Clone this wiki locally