Class XPTaskBarBox
Represents a task bar box within the XPTaskBar.
Inheritance
Namespace: Syncfusion.Windows.Forms.Tools
Assembly: Syncfusion.Tools.Windows.dll
Syntax
public class XPTaskBarBox : Control, IProvideLayoutInformation, ISupportInitialize
Remarks
The XPTaskBarBox contains a header and a content area.
The content area further contains 2 portions. The first portion(Task-List portion) shows a list of clickable tasks represented by the XPTaskBarItems. The second portion(Panel portion) shows a System.Windows.Forms.Panel in the content area, if there is a child Panel added to the child Controls list. Note that the XPTaskBarBox can contain only one Panel. If you try to add more than one Panel to the System.Windows.Forms.Control.Controls list, an exception will be thrown.
This control is XP Themes aware and if themes support is turned ON (ThemesEnabled property set to true), it will draw the header and the content portion using themes in XP. Optionally, you can owner draw the header portion and the content portion with a custom brush to create a Windows XP task menu look-and-feel in other platforms.
Examples
Take a look at the XPTaskBar class reference for an example on how to use this control.
Constructors
XPTaskBarBox()
Creates a new instance of the XPTaskBarBox.
Declaration
public XPTaskBarBox()
Fields
AnimationDelayInMilliSeconds
Specifies the animation delay when the task box is opened/closed. Default is 50ms.
Declaration
public static int AnimationDelayInMilliSeconds
Field Value
Type |
---|
System.Int32 |
AnimationPositions
Specifies the total animation positions. Default is 10.
Declaration
public static int AnimationPositions
Field Value
Type |
---|
System.Int32 |
SimulateThemedPaintingForNonDefaultThemes
Indicates whether themed drawing should be simulated for color schemes other than the default blue.
Declaration
public static bool SimulateThemedPaintingForNonDefaultThemes
Field Value
Type |
---|
System.Boolean |
Remarks
This is necessary because the themes API uses the blue color scheme to draw the background colors for all theme colors. Turn this off if you want to use the blue color scheme for all the other color schemes.
Properties
AnimationDelay
Gets / sets the AnimationDelay for the XPTaskBarBox.
Declaration
public int AnimationDelay { get; set; }
Property Value
Type |
---|
System.Int32 |
Remarks
Set this property to a different value if the AnimationDelay for this XPTaskBarBox is to be different. By default this is set to AnimationDelayInMilliSeconds.
AnimationPositionsCount
Gets / sets the AnimationPositions count for the XPTaskBarBox.
Declaration
public int AnimationPositionsCount { get; set; }
Property Value
Type |
---|
System.Int32 |
Remarks
Set this property to a different value if the AnimationPositions count for this XPTaskBarBox is to be different. By default this is set to AnimationPositions.
BackgroundImage
Overridden. See System.Windows.Forms.Control.BackgroundImage.
Declaration
public override Image BackgroundImage { get; set; }
Property Value
Type |
---|
System.Drawing.Image |
ChildPanel
Returns the current child System.Windows.Forms.Panel, if any.
Declaration
protected virtual Panel ChildPanel { get; }
Property Value
Type |
---|
System.Windows.Forms.Panel |
ClipHeaderText
Gets or sets a value indicating whether header text should be clipped.
Declaration
public bool ClipHeaderText { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Collapsed
Indicates the state of the task bar box.
Declaration
public bool Collapsed { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True if collapsed; false otherwise. Default is false. |
DefaultSize
Declaration
protected override Size DefaultSize { get; }
Property Value
Type |
---|
System.Drawing.Size |
DrawFocusRect
Indicates whether the control should take focus when the user click the header or an item.
Declaration
public virtual bool DrawFocusRect { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True to take focus; false otherwise. Default is true. |
ExpanderButton
Returns the button in the header used to collapse, expand the task bar box.
Declaration
protected ExpanderButton ExpanderButton { get; }
Property Value
Type |
---|
ExpanderButton |
Focused
Gets a value indicating whether the control has input focus.
Declaration
public bool Focused { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the control has focus; otherwise, false. |
FocusOnClick
Indicates whether the control should take focus when the user click the header or an item.
Declaration
[Obsolete]
public virtual bool FocusOnClick { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True to take focus; false otherwise. Default is true. |
FocusTextBounds
Gets or sets a value indicating whether focus should be set only to the text bounds.
Declaration
public bool FocusTextBounds { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Font
Gets or sets the text font with which the header text will be drawn.
Declaration
public override Font Font { get; set; }
Property Value
Type |
---|
System.Drawing.Font |
HeaderBackColor
Gets / sets the background color with which the header will be drawn.
Declaration
public Color HeaderBackColor { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Color | A Color value representing the header backcolor. |
Remarks
This setting will be ignored when XP Themes is set to be used for drawing the header.
HeaderDirection
Gets / sets the header direction.
Declaration
public XPTaskBarBox.HeaderDirectionFormat HeaderDirection { get; set; }
Property Value
Type |
---|
XPTaskBarBox.HeaderDirectionFormat |
HeaderFont
Gets / sets the text font with which the header text will be drawn.
Declaration
public Font HeaderFont { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Font | A Font value. Default is the Font property with Bold setting. |
Remarks
This will be ignored when ThemesEnabled is set to true.
HeaderForeColor
Gets or sets the fore color of the header.
Declaration
public Color HeaderForeColor { get; set; }
Property Value
Type |
---|
System.Drawing.Color |
Remarks
This setting will be ignored when XP Themes is set to be used for drawing the header.
HeaderHit
Indicates whether the mouse is currently over the header portion.
Declaration
public virtual bool HeaderHit { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True to indicate the mouse is over the header; false otherwise. |
HeaderImageIndex
Gets / sets the index into the HeaderImageList.
Declaration
public int HeaderImageIndex { get; set; }
Property Value
Type |
---|
System.Int32 |
Remarks
The zero-based index to the image in the XPTaskBarBox.HeaderImageList The default is -1, which signifies no image.
HeaderImageList
Gets / sets the ImageList that will be used to draw the header image.
Declaration
public ImageList HeaderImageList { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Forms.ImageList | An System.Windows.Forms.ImageList instance. Default is the value from the parent HeaderImageList property. |
Remarks
This ImageList will automatically be picked up from the parent XPTaskBar instance. You can override this behavior by setting a different ImageList in this property.
HeaderImageListAdv
Gets / sets the HeaderImageListAdv which contains the images with which the Items and the header will be drawn.
Declaration
public ImageListAdv HeaderImageListAdv { get; set; }
Property Value
Type | Description |
---|---|
ImageListAdv | An HeaderImageListAdv instance containing the images. |
HeaderTextAlign
Gets / sets the header text alignment.
Declaration
public StringAlignment HeaderTextAlign { get; set; }
Property Value
Type |
---|
System.Drawing.StringAlignment |
HitItem
Gets / sets the current XPTaskBarItem on which the mouse is on.
Declaration
protected virtual XPTaskBarItem HitItem { get; set; }
Property Value
Type | Description |
---|---|
XPTaskBarItem | An XPTaskBarItem instance. |
HitTaskBoxArea
Declaration
public bool HitTaskBoxArea { get; set; }
Property Value
Type |
---|
System.Boolean |
HotTrackColor
Gets or sets the hot tracking color.
Declaration
public Color HotTrackColor { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Color | The color of the hot track. |
ImageList
Gets / sets the ImageList which contains the images with which the Items and the header will be drawn.
Declaration
public ImageList ImageList { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Forms.ImageList | An ImageList instance containing the images. |
ImageListAdv
Gets / sets the ImageListAdv which contains the images with which the Items and the header will be drawn.
Declaration
public ImageListAdv ImageListAdv { get; set; }
Property Value
Type | Description |
---|---|
ImageListAdv | An ImageListAdv instance containing the images. |
ItemBackColor
Gets / sets the color with which the Items portion of the XPTaskBarBox will be drawn.
Declaration
public Color ItemBackColor { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Color | The Color value with which the Items portion will be drawn. |
Items
Returns the list of XPTaskBarItems.
Declaration
public XPTaskBarItemsCollection Items { get; }
Property Value
Type | Description |
---|---|
XPTaskBarItemsCollection | A XPTaskBarItemsCollection object. |
Remarks
You can add, remove, insert XPTaskBarItems into this collection.
NeedLayout
Indicates whether it's dimensions have changed, requiring a fresh layout.
Declaration
public bool NeedLayout { get; }
Property Value
Type |
---|
System.Boolean |
Remarks
Internal property. You do not have to call this property directly.
PADX
Gets / sets the horizontal padding provided in pixels between contents of the header and the header's left and right borders.
Declaration
public int PADX { get; set; }
Property Value
Type |
---|
System.Int32 |
PADY
Gets / sets the vertical padding provided in pixels between contents of the header and the header's top and bottom borders.
Declaration
public int PADY { get; set; }
Property Value
Type |
---|
System.Int32 |
Parent
Gets / sets the XPTaskBar parent.
Declaration
public XPTaskBar Parent { get; set; }
Property Value
Type |
---|
XPTaskBar |
PreferredChildPanelHeight
Gets / sets the preferred height required to draw the child panel.
Declaration
public int PreferredChildPanelHeight { get; set; }
Property Value
Type |
---|
System.Int32 |
Remarks
This will be the height set on the child panel. The Panel's width will be automatically set based on the available width for the XPTaskBarBox.
PreferredHeight
Gets / sets the preferred height for this control with the current settings.
Declaration
protected virtual int PreferredHeight { get; set; }
Property Value
Type |
---|
System.Int32 |
PropagateBackColorToItems
Specifies whether background color is propagated to items when it changes.
Declaration
public bool PropagateBackColorToItems { get; set; }
Property Value
Type |
---|
System.Boolean |
ShowCollapseButton
Indicates whether to show or hide the expand-collapse button in the header.
Declaration
public bool ShowCollapseButton { get; set; }
Property Value
Type |
---|
System.Boolean |
ShowToolTip
Indicates whether tooltip is shown.
Declaration
public bool ShowToolTip { get; set; }
Property Value
Type |
---|
System.Boolean |
ThemesEnabled
Reflects the corresponding property in the XPTaskBar parent.
Declaration
public bool ThemesEnabled { get; }
Property Value
Type |
---|
System.Boolean |
ToggleByButton
Indicates whether the XpTaskBarBox expands or collapses only when the Collapse Button is clicked or always when the header is clicked.
Declaration
public bool ToggleByButton { get; set; }
Property Value
Type |
---|
System.Boolean |
UseAdditionalAnimation
Gets or sets value indicating whether the items added or removed it's drawing with animation.
Declaration
public bool UseAdditionalAnimation { get; set; }
Property Value
Type |
---|
System.Boolean |
UseCustomColors
Gets/sets whether to enable HeaderBackColor, HeaderForeColor, ItemBackColor in XPTaskBarBox based on VisualStyle
Declaration
public bool UseCustomColors { get; set; }
Property Value
Type |
---|
System.Boolean |
WrapText
Indicates whether the item's text in XPTaskBarBox should get wrapped
Declaration
public bool WrapText { get; set; }
Property Value
Type |
---|
System.Boolean |
Methods
AttachChildPanel(Panel)
Called when a child System.Windows.Forms.Panel gets added to this control.
Declaration
protected virtual void AttachChildPanel(Panel childPanel)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Panel | childPanel | A System.Windows.Forms.Panel instance. |
AttemptStartDragging()
Declaration
protected void AttemptStartDragging()
BeginInit()
Signals the object that initialization is starting.
Declaration
public virtual void BeginInit()
CollapseContent()
Collapses the content area of this task bar box, if expanded, with animation.
Declaration
public void CollapseContent()
See Also
CollapseContent(Boolean)
Overloaded. Collapses the content area of this task bar box, if expanded.
Declaration
public void CollapseContent(bool useAnimation)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | useAnimation | Indicates whether to use animation while collapsing. |
See Also
DetachChildPanel(Panel)
Called when the child panel gets removed from this control.
Declaration
protected virtual void DetachChildPanel(Panel childPanel)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Panel | childPanel | The System.Windows.Forms.Panel instance. |
DetermineHeaderHeight(Graphics)
Advanced method to aid customization.
Declaration
protected virtual int DetermineHeaderHeight(Graphics g)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g | The System.Drawing.Graphics context. |
Returns
Type | Description |
---|---|
System.Int32 | The height for the header portion. |
Remarks
Called by UpdatePreferredHeight(Graphics) to determine the height for the header area.
DetermineItemsRectHeight(Graphics)
Advanced method to aid customization.
Declaration
protected virtual int DetermineItemsRectHeight(Graphics g)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g | The System.Drawing.Graphics context. |
Returns
Type | Description |
---|---|
System.Int32 | The height for the items area. |
Remarks
Called by UpdatePreferredHeight(Graphics) to determine the height for the items area.
DetermineItemsRectHeightOnHorizontalAlignment(Graphics)
Advanced method to aid customization.
Declaration
protected virtual int DetermineItemsRectHeightOnHorizontalAlignment(Graphics g)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g | The System.Drawing.Graphics context. |
Returns
Type | Description |
---|---|
System.Int32 | The height for the items area. |
Remarks
Called by UpdatePreferredHeight(Graphics) to determine the height for the items area.
Dispose(Boolean)
Overridden. See System.Windows.Forms.Control.Dispose(System.Boolean).
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
DrawHeader(PaintEventArgs)
Draws the header portion of the task bar box.
Declaration
protected virtual void DrawHeader(PaintEventArgs ea)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.PaintEventArgs | ea | The PaintEventArgs containing information about this Paint event. |
DrawItems(PaintEventArgs)
Draws the items portion of the task bar box.
Declaration
protected virtual void DrawItems(PaintEventArgs ea)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.PaintEventArgs | ea | The PaintEventArgs containing information about this Paint event. |
EndInit()
Signals the object that initialization is complete.
Declaration
public virtual void EndInit()
ExpandContent()
Overloaded. Expands the content area of this task bar box, if collapsed, with animation.
Declaration
public void ExpandContent()
See Also
ExpandContent(Boolean)
Expands the content area of this task bar box, if collapsed.
Declaration
public void ExpandContent(bool useAnimation)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | useAnimation | Indicates whether to use animation while expanding. |
See Also
FinishDragging()
Declaration
protected void FinishDragging()
GetExtraHeightForHeaderImage()
Declaration
protected virtual int GetExtraHeightForHeaderImage()
Returns
Type |
---|
System.Int32 |
GetHeaderBorderPath()
Returns the System.Drawing.Drawing2D.GraphicsPath object representing the header border.
Declaration
protected GraphicsPath GetHeaderBorderPath()
Returns
Type | Description |
---|---|
System.Drawing.Drawing2D.GraphicsPath | The GraphicsPath object. |
GetHeaderButtonSize()
Returns the size of the expand/collapse button.
Declaration
protected Size GetHeaderButtonSize()
Returns
Type | Description |
---|---|
System.Drawing.Size | The Size of the button. |
GetHeaderImageSize()
Declaration
protected Size GetHeaderImageSize()
Returns
Type |
---|
System.Drawing.Size |
GetHeaderRect()
The Rectangle representing the header.
Declaration
public virtual Rectangle GetHeaderRect()
Returns
Type | Description |
---|---|
System.Drawing.Rectangle | A Rectangle instance. |
GetHeaderTextBounds()
Returns the header text bounds.
Declaration
protected virtual Rectangle GetHeaderTextBounds()
Returns
Type | Description |
---|---|
System.Drawing.Rectangle | A Rectangle in the XPTaskBarBox client area. |
GetIsMirrored()
Declaration
protected bool GetIsMirrored()
Returns
Type |
---|
System.Boolean |
GetItemAtPoint(Point)
Retrieves the XPTaskBarItem item at point.
Declaration
protected XPTaskBarItem GetItemAtPoint(Point pt)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Point | pt | Point ( in screen coordinates ) to get item from. |
Returns
Type |
---|
XPTaskBarItem |
GetItemsRect()
The Rectangle representing the Items area.
Declaration
public virtual Rectangle GetItemsRect()
Returns
Type | Description |
---|---|
System.Drawing.Rectangle | A Rectangle instance. |
GetPreferredHeight()
Returns the preferred height for this box.
Declaration
public int GetPreferredHeight()
Returns
Type | Description |
---|---|
System.Int32 | The height in pixels. |
Remarks
Internally used by the XPTaskBar while laying out these controls.
GetPrefferedHeightForText(Graphics, String, Font, Int32, Boolean)
Advanced method to aid customization.
Declaration
protected virtual int GetPrefferedHeightForText(Graphics g, string text, Font font, int width, bool forheader)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g | The System.Drawing.Graphics context. |
System.String | text | The text for which to determine the height. |
System.Drawing.Font | font | |
System.Int32 | width | The available width. |
System.Boolean | forheader |
Returns
Type | Description |
---|---|
System.Int32 | The preferred height. |
Remarks
Called to determine the required height for the specified text given the available width.
HitTest(Point)
Returns the XPTaskBarItem at the specified point on the client.
Declaration
public XPTaskBarItem HitTest(Point mousePoint)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Point | mousePoint | The System.Drawing.Point representing the client co-ordinates. |
Returns
Type | Description |
---|---|
XPTaskBarItem | The XPTaskBarItem at the specified point. Null if none is found. |
IsInputKey(Keys)
Declaration
protected override bool IsInputKey(Keys keyData)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Keys | keyData |
Returns
Type |
---|
System.Boolean |
Layout(Graphics)
Lays out it's items.
Declaration
public virtual void Layout(Graphics g)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g | The Graphics object based on which to determine the sizes and positions. |
Remarks
Note that the XPTaskBarBox control follows a different layout pattern from a usual Windows Forms Control. When requested a Layout by the default Windows Forms Layout event, this control will only mark its child positions as dirty and recalculate its child positions when a subsequent Paint event occurs, with a call to this Layout method. This technique is followed to reduce flicker.
OnAfterAnimation(EventArgs)
Raises the AfterAnimation event.
Declaration
protected virtual void OnAfterAnimation(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | A EventArgs that contains the event data. |
Remarks
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The OnAfterAnimation method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnAfterAnimation in a derived class, be sure to call the base class's OnAfterAnimation method so that registered delegates receive the event.
OnBackColorChanged(EventArgs)
Overridden. See System.Windows.Forms.Control.OnBackColorChanged(System.EventArgs).
Declaration
protected override void OnBackColorChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnBeforeAnimation(EventArgs)
Raises the BeforeAnimation event.
Declaration
protected virtual void OnBeforeAnimation(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | A EventArgs that contains the event data. |
Remarks
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The OnBeforeAnimation method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnBeforeAnimation in a derived class, be sure to call the base class's OnBeforeAnimation method so that registered delegates receive the event.
OnCollapsedStateChanged(EventArgs)
Raises the CollapsedStateChanged event.
Declaration
protected virtual void OnCollapsedStateChanged(EventArgs args)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | args | A EventArgs instance that contains data related to this event. |
Remarks
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The OnCollapsedStateChanged method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnCollapsedStateChanged in a derived class, be sure to call the base class's OnCollapsedStateChanged method so that registered delegates receive the event.
OnCollapsedStateChanging(CancelEventArgs)
Raises the CollapsedStateChanging event
Declaration
protected virtual void OnCollapsedStateChanging(CancelEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
System.ComponentModel.CancelEventArgs | args | A EventArgs instance that contains data related to this event. |
OnControlAdded(ControlEventArgs)
Overridden. See System.Windows.Forms.Control.OnControlAdded(System.Windows.Forms.ControlEventArgs).
Declaration
protected override void OnControlAdded(ControlEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.ControlEventArgs | e | The ControlEventArgs that contains the event data. |
OnControlRemoved(ControlEventArgs)
Overridden. See System.Windows.Forms.Control.OnControlRemoved(System.Windows.Forms.ControlEventArgs).
Declaration
protected override void OnControlRemoved(ControlEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.ControlEventArgs | e | The ControlEventArgs that contains the event data. |
OnDragDrop(DragEventArgs)
Declaration
protected override void OnDragDrop(DragEventArgs drgevent)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.DragEventArgs | drgevent |
OnDragEnter(DragEventArgs)
Declaration
protected override void OnDragEnter(DragEventArgs drgevent)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.DragEventArgs | drgevent |
OnDragLeave(EventArgs)
Declaration
protected override void OnDragLeave(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnDragOver(DragEventArgs)
Declaration
protected override void OnDragOver(DragEventArgs drgevent)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.DragEventArgs | drgevent |
OnEnter(EventArgs)
Declaration
protected override void OnEnter(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnFontChanged(EventArgs)
Overridden. See System.Windows.Forms.Control.OnFontChanged(System.EventArgs).
Declaration
protected override void OnFontChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnHandleCreated(EventArgs)
Declaration
protected override void OnHandleCreated(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnItemClick(XPTaskBarItemClickArgs)
Raises the ItemClick event.
Declaration
protected virtual void OnItemClick(XPTaskBarItemClickArgs args)
Parameters
Type | Name | Description |
---|---|---|
XPTaskBarItemClickArgs | args | An XPTaskBarItemClickArgs instance containing data regarding this event. |
Remarks
Raising an event invokes the event handler through a delegate.
The OnItemClick method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnItemClick in a derived class, be sure to call the base class's OnItemClick method so that registered delegates receive the event.
OnKeyDown(KeyEventArgs)
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.KeyEventArgs | e |
OnLayoutNeed(EventArgs)
Raises the LayoutNeed event.
Declaration
protected virtual void OnLayoutNeed(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | A EventArgs that contains the event data. |
OnLeave(EventArgs)
Declaration
protected override void OnLeave(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnLostFocus(EventArgs)
Deactivate tooltip on LostFocus event.
Declaration
protected override void OnLostFocus(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnMouseDown(MouseEventArgs)
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 |
OnMouseHover(EventArgs)
Declaration
protected override void OnMouseHover(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnMouseLeave(EventArgs)
Overridden. See System.Windows.Forms.Control.OnMouseLeave(System.EventArgs).
Declaration
protected override void OnMouseLeave(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | EventArgs that contains the event data. |
OnMouseMove(MouseEventArgs)
Overridden. See System.Windows.Forms.Control.OnMouseMove(System.Windows.Forms.MouseEventArgs).
Declaration
protected override void OnMouseMove(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | e |
OnMouseUp(MouseEventArgs)
Overridden. See System.Windows.Forms.Control.OnMouseUp(System.Windows.Forms.MouseEventArgs).
Declaration
protected override void OnMouseUp(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | e |
OnPaint(PaintEventArgs)
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 |
OnProvideHeaderBackGroundBrush(ProvideBrushEventArgs)
Raises the ProvideHeaderBackgroundBrush event.
Declaration
protected virtual void OnProvideHeaderBackGroundBrush(ProvideBrushEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
ProvideBrushEventArgs | args | A ProvideBrushEventArgs instance containing data regarding this event. |
Remarks
Raising an event invokes the event handler through a delegate.
The OnProvideHeaderBackGroundBrush method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnProvideHeaderBackGroundBrush in a derived class, be sure to call the base class's OnProvideHeaderBackGroundBrush method so that registered delegates receive the event.
OnProvideItemsBackGroundBrush(ProvideBrushEventArgs)
Raises the ProvideItemsBackgroundBrush event.
Declaration
protected virtual void OnProvideItemsBackGroundBrush(ProvideBrushEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
ProvideBrushEventArgs | args | A ProvideItemsBackgroundBrush instance that contains data related to this event. |
Remarks
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The OnProvideItemsBackGroundBrush method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnProvideItemsBackGroundBrush in a derived class, be sure to call the base class's OnProvideItemsBackGroundBrush method so that registered delegates receive the event.
OnTextChanged(EventArgs)
Overridden. See System.Windows.Forms.Control.OnTextChanged(System.EventArgs).
Declaration
protected override void OnTextChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | EventArgs that contains the event data. |
PerformItemClick(XPTaskBarItem)
Raises the ItemClick event for the specified XPTaskBarItem.
Declaration
public void PerformItemClick(XPTaskBarItem item)
Parameters
Type | Name | Description |
---|---|---|
XPTaskBarItem | item | A XPTaskBarItem instance. |
ProcessDragDrop(DragEventArgs)
Initiates the DragDrop process.
Declaration
protected void ProcessDragDrop(DragEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.DragEventArgs | e |
ProcessDragEnter(DragEventArgs)
Initiates the DragEnter process.
Declaration
protected void ProcessDragEnter(DragEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.DragEventArgs | e |
ProcessDragLeave()
Initiates the DragLeave process.
Declaration
protected void ProcessDragLeave()
ProcessDragOver(DragEventArgs)
Initiates the DragOver process.
Declaration
protected void ProcessDragOver(DragEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.DragEventArgs | e |
ResetAnimationDelay()
Declaration
public void ResetAnimationDelay()
ResetAnimationPositionsCount()
Declaration
public void ResetAnimationPositionsCount()
ResetHeaderBackColor()
Resets the header backcolor to its default value.
Declaration
protected virtual void ResetHeaderBackColor()
ResetHeaderFont()
Declaration
public void ResetHeaderFont()
ResetHeaderForeColor()
Resets the header forecolor to its default value.
Declaration
protected virtual void ResetHeaderForeColor()
ResetHeaderImageList()
Declaration
public void ResetHeaderImageList()
ResetItemBackColor()
Resets the item backcolor to its default value.
Declaration
protected virtual void ResetItemBackColor()
ResetUseVisualStyleColor()
Resets UseVisualStyleColor property to its default value
Declaration
protected void ResetUseVisualStyleColor()
ResetWrapText()
resets the wraptext value
Declaration
public void ResetWrapText()
ShouldSerializeAnimationDelay()
Declaration
public bool ShouldSerializeAnimationDelay()
Returns
Type |
---|
System.Boolean |
ShouldSerializeAnimationPositionsCount()
Declaration
public bool ShouldSerializeAnimationPositionsCount()
Returns
Type |
---|
System.Boolean |
ShouldSerializeHeaderBackColor()
Indicates whether the Header BackColor has a value different from its default value.
Declaration
protected virtual bool ShouldSerializeHeaderBackColor()
Returns
Type |
---|
System.Boolean |
ShouldSerializeHeaderFont()
Declaration
public bool ShouldSerializeHeaderFont()
Returns
Type |
---|
System.Boolean |
ShouldSerializeHeaderForeColor()
Indicates whether the Header ForeColor has a value different from its default value.
Declaration
protected virtual bool ShouldSerializeHeaderForeColor()
Returns
Type |
---|
System.Boolean |
ShouldSerializeHeaderImageList()
Declaration
public bool ShouldSerializeHeaderImageList()
Returns
Type |
---|
System.Boolean |
ShouldSerializeItemBackColor()
Indicates whether the Item BackColor has a value different from its default value.
Declaration
protected virtual bool ShouldSerializeItemBackColor()
Returns
Type |
---|
System.Boolean |
ShouldSerializeUseVisualStyleColor()
Serializes UseVisualStyleColor property
Declaration
protected virtual bool ShouldSerializeUseVisualStyleColor()
Returns
Type |
---|
System.Boolean |
ShouldSerializeWrapText()
Serializes the Wraptext value
Declaration
public bool ShouldSerializeWrapText()
Returns
Type |
---|
System.Boolean |
ShouldToggle()
Indicates whether the collapse button has to be toggled.
Declaration
protected bool ShouldToggle()
Returns
Type |
---|
System.Boolean |
ToggleContentVisibility(Boolean)
Toggles the collapsed/expanded state of the box.
Declaration
protected virtual void ToggleContentVisibility(bool useAnimation)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | useAnimation | Indicates whether to use animation. |
UpdateChildPanelBounds(Int32)
Called to update the child panel's bounds, based on the current settings and layout.
Declaration
protected virtual void UpdateChildPanelBounds(int top)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | top | The top location for the Panel. |
UpdateExpanderButtonPosition()
Advanced method to aid customization.
Declaration
protected virtual void UpdateExpanderButtonPosition()
Remarks
Updates the expander button position based on the current box dimensions.
UpdatePreferredHeight(Graphics)
Advanced method to aid customization.
Declaration
protected virtual void UpdatePreferredHeight(Graphics g)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g | The System.Drawing.Graphics context. |
WndProc(ref Message)
Declaration
protected override void WndProc(ref Message m)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Message | m |
Events
AfterAnimation
This event gets called after the box expands or collapses.
Declaration
public event EventHandler AfterAnimation
Event Type
Type |
---|
System.EventHandler |
BeforeAnimation
This event gets called before the box expands or collapses.
Declaration
public event EventHandler BeforeAnimation
Event Type
Type |
---|
System.EventHandler |
CollapsedStateChanged
Occurs after the box has been collapsed or expanded.
Declaration
public event EventHandler CollapsedStateChanged
Event Type
Type |
---|
System.EventHandler |
CollapsedStateChanging
Occurs when the box has being collapsed or expanded.
Declaration
public event CancelEventHandler CollapsedStateChanging
Event Type
Type |
---|
System.ComponentModel.CancelEventHandler |
ItemClick
The event that gets thrown when the user clicks on an item.
Declaration
public event XPTaskBarItemClickHandler ItemClick
Event Type
Type |
---|
XPTaskBarItemClickHandler |
Remarks
The XPTaskBarItemClickArgs contains a reference to the XPTaskBarItem that was clicked.
Examples
private void xpTaskBarBox_ItemClick(object sender, Syncfusion.Windows.Forms.Tools.XPTaskBarItemClickArgs e)
{
this.aboutDrawingLabel.BorderStyle = BorderStyle.None;
this.aboutLable.BorderStyle = BorderStyle.None;
this.aboutItemsLabel.BorderStyle = BorderStyle.None;
switch(e.XPTaskBarItem.Tag as string)
{
case "about":
this.aboutLable.BorderStyle = BorderStyle.FixedSingle;
break;
case "about items":
this.aboutItemsLabel.BorderStyle = BorderStyle.FixedSingle;
break;
case "about drawing":
this.aboutDrawingLabel.BorderStyle = BorderStyle.FixedSingle;
break;
case "aboutSyncfusion":
this.ShowAboutDialog();
break;
}
}
Private Sub xpTaskBarBox_ItemClick(ByVal sender As Object, ByVal e As XPTaskBarItemClickArgs)
Me.aboutDrawingLabel.BorderStyle = BorderStyle.None
Me.aboutLable.BorderStyle = BorderStyle.None
Me.aboutItemsLabel.BorderStyle = BorderStyle.None
Select Case CType(e.XPTaskBarItem.Tag, String)
Case "about"
Me.aboutLable.BorderStyle = BorderStyle.FixedSingle
'End Section
Case "about items"
Me.aboutItemsLabel.BorderStyle = BorderStyle.FixedSingle
'End Section
Case "about drawing"
Me.aboutDrawingLabel.BorderStyle = BorderStyle.FixedSingle
'End Section
Case "aboutSyncfusion"
Me.ShowAboutDialog()
'End Section
End Select
End Sub
LayoutNeed
This event is raised when
Declaration
public event EventHandler LayoutNeed
Event Type
Type |
---|
System.EventHandler |
ProvideHeaderBackgroundBrush
Occurs when the header portion of the XPTaskBarBox gets drawn.
Declaration
public event ProvideBrushEventHandler ProvideHeaderBackgroundBrush
Event Type
Type |
---|
ProvideBrushEventHandler |
Remarks
This event allows you to provide a Brush with which the background of the header will get drawn. This event will not be fired when XP Themes is set to be used to render the header.
Examples
private void xpTaskBarBox_ProvideHeaderBackgroundBrush(object sender, Syncfusion.Windows.Forms.Tools.ProvideBrushEventArgs args)
{
// Blend settings
float[] relativeIntensities = {0.0f, 0.0f, 1.0f};
float[] relativePositions = {0.0F, 0.5f, 1.0F};
Blend blend = new Blend();
blend.Factors = relativeIntensities;
blend.Positions = relativePositions;
XPTaskBarBox box = sender as XPTaskBarBox;
// Header back brush
LinearGradientBrush lgBrush = new LinearGradientBrush(args.Bounds,
Color.White, box.HeaderBackColor, 0, true);
lgBrush.Blend = blend;
args.Brush = lgBrush;
}
Private Sub xpTaskBarBox_ProvideHeaderBackgroundBrush(ByVal sender As Object, ByVal args As ProvideBrushEventArgs)
' Blend settings
Dim relativeIntensities() As Single
relativeIntensities = New Single() {0.0!, 0.0!, 1.0!}
Dim relativePositions() As Single
relativePositions = New Single() {0.0!, 0.5!, 1.0!}
Dim blend As Blend
blend = New Blend()
blend.Factors = relativeIntensities
blend.Positions = relativePositions
Dim box As XPTaskBarBox
box = CType(sender, XPTaskBarBox)
' Header back brush
Dim lgBrush As LinearGradientBrush
lgBrush = New LinearGradientBrush(args.Bounds, Color.White, box.HeaderBackColor, 0, True)
lgBrush.Blend = blend
args.Brush = lgBrush
End Sub
ProvideItemsBackgroundBrush
Occurs when the content portion of the XPTaskBarBox gets drawn.
Declaration
public event ProvideBrushEventHandler ProvideItemsBackgroundBrush
Event Type
Type |
---|
ProvideBrushEventHandler |
Remarks
This event allows you to provide a Brush with which the background of the content portion will be drawn. This event will not be fired when XP Themes is set to be used for drawing the XPTaskBarBox.
Examples
private void xpTaskBarBox_ProvideItemsBackgroundBrush(object sender, Syncfusion.Windows.Forms.Tools.ProvideBrushEventArgs args)
{
// Blend settings
float[] relativeIntensities = {0.0f, 0.0f, 1.0f};
float[] relativePositions = {0.0F, 0.5f, 1.0F};
Blend blend = new Blend();
blend.Factors = relativeIntensities;
blend.Positions = relativePositions;
// Items back brush
LinearGradientBrush lgBrush = new LinearGradientBrush(args.Bounds,
Color.WhiteSmoke, Color.Silver, 91, false);
lgBrush.Blend = blend;
args.Brush = lgBrush;
}
Private Sub xpTaskBarBox_ProvideItemsBackgroundBrush(ByVal sender As Object, ByVal args As ProvideBrushEventArgs)
' Blend settings
Dim relativeIntensities() As Single
relativeIntensities = New Single() {0.0!, 0.0!, 1.0!}
Dim relativePositions() As Single
relativePositions = New Single() {0.0!, 0.5!, 1.0!}
Dim blend As Blend
blend = New Blend()
blend.Factors = relativeIntensities
blend.Positions = relativePositions
' Items back brush
Dim lgBrush As LinearGradientBrush
lgBrush = New LinearGradientBrush(args.Bounds, Color.WhiteSmoke, Color.Silver, 91, False)
lgBrush.Blend = blend
args.Brush = lgBrush
End Sub
Explicit Interface Implementations
IProvideLayoutInformation.MinimumSize
Declaration
Size IProvideLayoutInformation.MinimumSize { get; }
Returns
Type |
---|
System.Drawing.Size |
IProvideLayoutInformation.PreferredSize
Declaration
Size IProvideLayoutInformation.PreferredSize { get; }
Returns
Type |
---|
System.Drawing.Size |