Each ToolWindow has a fixed 1-pixel border whose color can be changed via the BorderColor property. If the BorderColor property is set to Transparent or Empty then the tool window will not have its default 1-pixel border.
In order to change the width of the border surrounding a tool window, the following steps are required:
The following example demonstrates how to create a tool window that has a 5-pixel light blue border.
VB.NET |
Copy Code |
---|---|
Imports System Imports System.Collections Imports System.ComponentModel Imports System.Drawing Imports System.Data Imports System.Windows.Forms Namespace Xceed.DockingWindows.Samples Public Class ToolWindowBorder Inherits Xceed.DockingWindows.ToolWindow Private components As System.ComponentModel.Container = Nothing Public Sub New( key As String, text As String, borderColor As Color ) InitializeComponent() Me.Key = key Me.Text = text Me.BackColor = borderColor Me.BorderColor = Color.Empty Me.DockPadding.All = 5 Dim panel As New Panel() panel.BackColor = SystemColors.Control panel.Dock = DockStyle.Fill Me.Controls.Add( panel ) End Sub Protected Overrides Overloads Sub Dispose( disposing As Boolean ) If disposing Then If Not components Is Nothing Then components.Dispose() End If End If MyBase.Dispose( disposing ) End Sub Private Sub InitializeComponent() Me.Name = "ToolWindowBorder" Me.Size = New System.Drawing.Size(296, 328) End Sub End Class End Namespace |
C# |
Copy Code |
---|---|
using System; namespace Xceed.DockingWindows.Samples public ToolWindowBorder( string key, string text, Color borderColor ) this.Key = key; Panel panel = new Panel(); this.Controls.Add( panel ); protected override void Dispose( bool disposing ) private void InitializeComponent() |