-
Notifications
You must be signed in to change notification settings - Fork 65
Home
Welcome to the CSDeskBand wiki!
This is a quick guide to get you started. You can decide whether to create your Deskband with Winforms or Wpf.
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
You can add items to the deskband context menu through Options.ContextMenuItems
.
// 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
The TaskbarInfo
property allows you to get information about the state of the size, orientation and edge of the taskbar.
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
There are issues with transparency for WPF. Due to the airspace issue, we can't have a transparent WPF window since the taskbar uses win32 (gdi/gdi+). The current solution is to host the WPF user control in a ElementHost
which is then hosted in a Winforms Form
that uses a transparency key. This of course creates issues with anti aliasing and can cause artifacts. The color key can be changed through the TransparencyColorKey
property.