The XPToolBar class provides you a tool bar like look-and-feel that you can use
outside the XPMenus framework to display BarItems.
Inheritance
System.Object
Syncfusion.Windows.Forms.Tools.XPMenus.BarControlInternal
XPToolBar
Implements
System.IDisposable
Assembly: Syncfusion.Tools.Windows.dll
public class XPToolBar : BarControlInternal, IThemeProvider, IDisposable, IBarControl, IThemedControl, IBarItemContainerControl, ICallWndProcListener, IBarHost, IDesignable, IIgnoreWorkingArea, IVisualStyle
In code, you can initialize an XPToolBar as follows:
XPToolBar xpToolBar1;
// Create a new tool bar control.
XPToolBar xptoolbar2 = new XPToolBar();
// Add some one or more instances of BarItem to it.
xptoolbar2.Items.AddRange(new BarItem[]{this.barItem1, this.barItem2, this.barItem3});
// Setup a separator.
xptoolbar2.BeginGroupAt(this.barItem2);
// Set its position and add it to the Form.
xptoolbar2.Dock = DockStyle.Top;
xptoolbar2.Size = new Size(200, 30);
this.Controls.Add(xptoolbar2);
Dim xpToolBar1 As XPToolBar
' Create a new tool bar control.
Dim xptoolbar2 As New XPToolBar()
' Add some one or more instances of BarItem to it.
xptoolbar2.Items.AddRange(New BarItem() {Me.barItem1, Me.barItem2, Me.barItem3})
' Setup a separator.
xptoolbar2.BeginGroupAt(Me.barItem2)
' Set its position and add it to the Form.
xptoolbar2.Dock = DockStyle.Top
xptoolbar2.Size = New Size(200, 30)
Me.Controls.Add(xptoolbar2)
Constructors
Initializes a new instance of the XPToolBar class.
Declaration
Properties
Gets / sets the background color, gradient and other styles of the toolbar.
Declaration
public BrushInfo BackgroundColor { get; set; }
Property Value
Declaration
public override Bar Bar { get; set; }
Property Value
Overrides
Syncfusion.Windows.Forms.Tools.XPMenus.BarControlInternal.Bar
Indicates whether the BarItems should check for ActiveForm before displaying tooltip. Workaround for using from MFC applications.
Declaration
public bool BarItemActiveFormCheckOverride { get; set; }
Property Value
Declaration
protected override Size DefaultSize { get; }
Property Value
Gets or sets value to enable or disable the Touchmode to the controls.
Declaration
public bool EnableTouchMode { get; set; }
Property Value
Read only. Gets the invisible BarItems that are hidden in the popup when the ShowChevron is set to true.
Declaration
public BarItems HiddenBarItems { get; }
Property Value
Type |
Description |
BarItems |
Array or BarItems.
|
Declaration
protected override Form HostedForm { get; set; }
Property Value
Type |
System.Windows.Forms.Form |
Overrides
Syncfusion.Windows.Forms.Tools.XPMenus.BarControlInternal.HostedForm
Provides information, whether popup is ignoring
working area of the display before showing.
Declaration
public bool IgnoreWorkingArea { get; set; }
Property Value
Returns the collection of BarItem objects associated
with this XPToolBar.
Declaration
public BarItems Items { get; }
Property Value
The following example code adds three bar items to the XPToolBar.
private void Form_Load(object sender, System.EventArgs e)
{
this.barControl1.Items.Add(this.barItem1);
this.barControl1.Items.Add(this.barItem2);
this.barControl1.Items.Add(this.parentBarItem1);
}
Indicates whether the images from the LargeImageList
of the BarItems should be used while drawing the BarItems.
Declaration
public override bool LargeIcons { get; set; }
Property Value
Type |
Description |
System.Boolean |
True to use the large image list; false to use the default image list. Default value is false.
|
Overrides
Syncfusion.Windows.Forms.Tools.XPMenus.BarControlInternal.LargeIcons
Declaration
protected bool NeedLayout { get; }
Property Value
Gets or sets colorschemes for Office2007 visual style.
Declaration
public Office2007Theme Office2007Theme { get; set; }
Property Value
Gets or sets colorschemes for Office2010 visual style.
Declaration
public Office2010Theme Office2010Theme { get; set; }
Property Value
Returns the preferred size based on the current settings.
Declaration
public Size PreferredSize { get; }
Property Value
Type |
Description |
System.Drawing.Size |
A System.Drawing.Size instance.
|
Gets or sets a value indicating whether items of the XPToolBar will be draws Horizontal
when XPToolBar is vertical docked.
Declaration
public bool RotateWhenVertical { get; set; }
Property Value
gets the separator indices.
Declaration
public VisuallyInheritableIntList SeparatorIndices { get; }
Property Value
Indicates whether to show chevron.
Declaration
public bool ShowChevron { get; set; }
Property Value
Indicates whether to highlight BarItem when mouse moves over it.
Declaration
public bool ShowHighlightRectangle { get; set; }
Property Value
Gets or sets a value indicating whether the user can give the focus to this
control using the TAB key.
Declaration
public bool TabStop { get; set; }
Property Value
Advanced property, meant for use at design-time.
Declaration
public IntListDesignTime UpdatedBarItemPositions { get; set; }
Property Value
Advanced property, meant for use at design-time.
Declaration
public IntListDesignTime UpdatedSeparatorPositions { get; set; }
Property Value
Indicates whether the UpdateUI events for the BarItems
should be fired MFC style on Application.Idle.
Declaration
public bool UpdateUIMFCStyle { get; set; }
Property Value
Type |
Description |
System.Boolean |
True to fire the UpdateUI event; false otherwise. Default is false.
|
Methods
Declaration
public void AfterCodeDomSerialize()
Scale the control based on the scale factor passed in the argument.
Declaration
public void ApplyScaleToControl(float scaleFactor)
Parameters
Type |
Name |
Description |
System.Single |
scaleFactor |
value to scale the factor based upon.
|
Declaration
protected override void Bar_PropertyChanged(object sender, SyncfusionPropertyChangedEventArgs e)
Parameters
Overrides
Syncfusion.Windows.Forms.Tools.XPMenus.BarControlInternal.Bar_PropertyChanged(System.Object, Syncfusion.ComponentModel.SyncfusionPropertyChangedEventArgs)
Declaration
public void BeforeCodeDomSerialize()
Lets you specify a separator in the BarItems list. The separator will be
just before the specified BarItem.
Declaration
public void BeginGroupAt(BarItem barItem)
Parameters
Type |
Name |
Description |
BarItem |
barItem |
A BarItem present in the Items list.
|
Declaration
protected override void Dispose(bool disposing)
Parameters
Type |
Name |
Description |
System.Boolean |
disposing |
|
Overrides
Syncfusion.Windows.Forms.Tools.XPMenus.BarControlInternal.Dispose(System.Boolean)
Helps to get the ControlName settings in control.
Declaration
public override string GetControlName(string controlName)
Parameters
Type |
Name |
Description |
System.String |
controlName |
|
Returns
Overrides
Declaration
protected override bool GetUseControlForeColor()
Returns
Overrides
Syncfusion.Windows.Forms.Tools.XPMenus.BarControlInternal.GetUseControlForeColor()
Hides the currently open popup.
Declaration
Declaration
public void InitBarFromDesigner(BarManager manager)
Parameters
Indicates whether a separator is drawn just before the specified BarItem.
Declaration
public bool IsGroupBeginning(BarItem barItem)
Parameters
Type |
Name |
Description |
BarItem |
barItem |
A BarItem present in the Items list.
|
Returns
Type |
Description |
System.Boolean |
True if there is a separator; false if not.
|
Declaration
public bool IsItemHit(Point ptClient)
Parameters
Type |
Name |
Description |
System.Drawing.Point |
ptClient |
|
Returns
Declaration
protected override void Layout(IGraphicsProvider gp)
Parameters
Overrides
Syncfusion.Windows.Forms.Tools.XPMenus.BarControlInternal.Layout(Syncfusion.Drawing.IGraphicsProvider)
Declaration
public void MoveMenuNavigation(bool forward)
Parameters
Type |
Name |
Description |
System.Boolean |
forward |
|
Declaration
public override bool NeedKey(Keys key)
Parameters
Type |
Name |
Description |
System.Windows.Forms.Keys |
key |
|
Returns
Overrides
Syncfusion.Windows.Forms.Tools.XPMenus.BarControlInternal.NeedKey(System.Windows.Forms.Keys)
Declaration
public void OnBarBoundsChanged()
Helps to apply the CanApplyTheme settings in control.
Declaration
public override void OnCanApplyThemeChanged(bool canApplyTheme)
Parameters
Type |
Name |
Description |
System.Boolean |
canApplyTheme |
|
Overrides
Helps to apply the CanOverriderStyle settings in control.
Declaration
public override void OnCanOverrideStyleChanged(bool canOverriderStyle)
Parameters
Type |
Name |
Description |
System.Boolean |
canOverriderStyle |
|
Overrides
Declaration
protected override void OnDockChanged(EventArgs e)
Parameters
Type |
Name |
Description |
System.EventArgs |
e |
|
Overridden. See System.Windows.Forms.Control.OnDragDrop(System.Windows.Forms.DragEventArgs).
Declaration
protected override void OnDragDrop(DragEventArgs e)
Parameters
Type |
Name |
Description |
System.Windows.Forms.DragEventArgs |
e |
|
Overrides
Syncfusion.Windows.Forms.Tools.XPMenus.BarControlInternal.OnDragDrop(System.Windows.Forms.DragEventArgs)
Overridden. See System.Windows.Forms.Control.OnDragLeave(System.EventArgs).
Declaration
protected override void OnDragLeave(EventArgs e)
Parameters
Type |
Name |
Description |
System.EventArgs |
e |
|
Overrides
Syncfusion.Windows.Forms.Tools.XPMenus.BarControlInternal.OnDragLeave(System.EventArgs)
Overridden. See System.Windows.Forms.Control.OnDragOver(System.Windows.Forms.DragEventArgs).
Declaration
protected override void OnDragOver(DragEventArgs drgevent)
Parameters
Type |
Name |
Description |
System.Windows.Forms.DragEventArgs |
drgevent |
|
Overrides
Syncfusion.Windows.Forms.Tools.XPMenus.BarControlInternal.OnDragOver(System.Windows.Forms.DragEventArgs)
Declaration
protected override void OnFontChanged(EventArgs e)
Parameters
Type |
Name |
Description |
System.EventArgs |
e |
|
Overridden. See System.Windows.Forms.Control.OnGotFocus(System.EventArgs).
Declaration
protected override void OnGotFocus(EventArgs e)
Parameters
Type |
Name |
Description |
System.EventArgs |
e |
|
Overrides
Syncfusion.Windows.Forms.Tools.XPMenus.BarControlInternal.OnGotFocus(System.EventArgs)
Declaration
protected override void OnHandleCreated(EventArgs e)
Parameters
Type |
Name |
Description |
System.EventArgs |
e |
|
Overrides
Syncfusion.Windows.Forms.Tools.XPMenus.BarControlInternal.OnHandleCreated(System.EventArgs)
Overridden. See System.Windows.Forms.Control.OnLostFocus(System.EventArgs).
Declaration
protected override void OnLostFocus(EventArgs e)
Parameters
Type |
Name |
Description |
System.EventArgs |
e |
|
Overridden. See System.Windows.Forms.Control.OnMouseDown(System.Windows.Forms.MouseEventArgs).
Declaration
protected override void OnMouseDown(MouseEventArgs e)
Parameters
Type |
Name |
Description |
System.Windows.Forms.MouseEventArgs |
e |
|
Overrides
Syncfusion.Windows.Forms.Tools.XPMenus.BarControlInternal.OnMouseDown(System.Windows.Forms.MouseEventArgs)
Overridden. See System.Windows.Forms.Control.OnPaint(System.Windows.Forms.PaintEventArgs).
Declaration
protected override void OnPaint(PaintEventArgs e)
Parameters
Type |
Name |
Description |
System.Windows.Forms.PaintEventArgs |
e |
|
Overrides
Syncfusion.Windows.Forms.Tools.XPMenus.BarControlInternal.OnPaint(System.Windows.Forms.PaintEventArgs)
Declaration
protected override void OnPaintBackground(PaintEventArgs e)
Parameters
Type |
Name |
Description |
System.Windows.Forms.PaintEventArgs |
e |
|
Declaration
protected virtual void OnRotateWhenVerticalChanged()
Helps to apply the ThemeName settings in control.
Declaration
public override void OnThemeNameChanged(string themeName)
Parameters
Type |
Name |
Description |
System.String |
themeName |
ThemeName
|
Overrides
Overridden. See System.Windows.Forms.Control.ProcessCmdKey(System.Windows.Forms.Message@,System.Windows.Forms.Keys).
Declaration
protected override bool ProcessDialogKey(Keys keyData)
Parameters
Type |
Name |
Description |
System.Windows.Forms.Keys |
keyData |
|
Returns
Declaration
protected override void ProcessDragDrop(DragEventArgs e)
Parameters
Type |
Name |
Description |
System.Windows.Forms.DragEventArgs |
e |
|
Overrides
Syncfusion.Windows.Forms.Tools.XPMenus.BarControlInternal.ProcessDragDrop(System.Windows.Forms.DragEventArgs)
Declaration
protected override void ProcessDragLeave(EventArgs e)
Parameters
Type |
Name |
Description |
System.EventArgs |
e |
|
Overrides
Syncfusion.Windows.Forms.Tools.XPMenus.BarControlInternal.ProcessDragLeave(System.EventArgs)
Declaration
protected override void ProcessDragOver(DragEventArgs drgevent)
Parameters
Type |
Name |
Description |
System.Windows.Forms.DragEventArgs |
drgevent |
|
Overrides
Syncfusion.Windows.Forms.Tools.XPMenus.BarControlInternal.ProcessDragOver(System.Windows.Forms.DragEventArgs)
Declaration
protected override bool ProcessMnemonic(char charCode)
Parameters
Type |
Name |
Description |
System.Char |
charCode |
|
Returns
Overrides
Syncfusion.Windows.Forms.Tools.XPMenus.BarControlInternal.ProcessMnemonic(System.Char)
Forces BarItem to fire The ItemClick event, when specified shortcut for this BarItem entered by the user.
Declaration
public void ProcessShortcut(Keys keyData)
Parameters
Type |
Name |
Description |
System.Windows.Forms.Keys |
keyData |
Shortcut to process.
|
Removes the separator just before this BarItem.
Declaration
public void RemoveGroupAt(BarItem barItem)
Parameters
Type |
Name |
Description |
BarItem |
barItem |
A BarItem present in the Items list.
|
Declaration
protected override void RendererChanged(BarRenderer rendererNew)
Parameters
Overrides
Syncfusion.Windows.Forms.Tools.XPMenus.BarControlInternal.RendererChanged(Syncfusion.Windows.Forms.Tools.XPMenus.BarRenderer)
Declaration
protected override bool RequiresActiveFormForMouseTrack()
Returns
Overrides
Syncfusion.Windows.Forms.Tools.XPMenus.BarControlInternal.RequiresActiveFormForMouseTrack()
Declaration
protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified)
Parameters
Type |
Name |
Description |
System.Int32 |
x |
|
System.Int32 |
y |
|
System.Int32 |
width |
|
System.Int32 |
height |
|
System.Windows.Forms.BoundsSpecified |
specified |
|
Declaration
protected void SetNeedLayout(bool value)
Parameters
Type |
Name |
Description |
System.Boolean |
value |
|
Specified whether themed background of the parent control will be drawn.
Declaration
public override bool ShouldDelegateBGDrawingToParentWhenThemed()
Returns
Overrides
Syncfusion.Windows.Forms.Tools.XPMenus.BarControlInternal.ShouldDelegateBGDrawingToParentWhenThemed()
Overrides the ShouldPreProcessTab method.
Declaration
public override bool ShouldPreProcessTab()
Returns
Overrides
Syncfusion.Windows.Forms.Tools.XPMenus.BarControlInternal.ShouldPreProcessTab()
Shows the popup of the specified item.
Declaration
public void ShowPopup(ParentBarItem item)
Parameters
Type |
Name |
Description |
ParentBarItem |
item |
Parent bar item to show popup items.
|
Declaration
protected void SubscribeDragDrop()
Declaration
protected void UnSubscribeDragDrop()
Declaration
protected override void UpdateColorScheme()
Overrides
Syncfusion.Windows.Forms.Tools.XPMenus.BarControlInternal.UpdateColorScheme()
Declaration
protected virtual void UpdateSeparatorIndices()
Overridden. See System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message@).
Declaration
protected override void WndProc(ref Message m)
Parameters
Type |
Name |
Description |
System.Windows.Forms.Message |
m |
|
Overrides
Syncfusion.Windows.Forms.Tools.XPMenus.BarControlInternal.WndProc(System.Windows.Forms.Message)
Explicit Interface Implementations
Declaration
bool IDesignable.DesignMode { get; }
Returns
Declaration
string IVisualStyle.VisualTheme { get; set; }
Returns
Implements
System.IDisposable