Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Collapse]Ribbon, Bars and Menu
   [Expand]Bars
   [Expand]Ribbon
   [Expand]Popup Menus
    Radial Menu
   [Expand]Common Features
   [Collapse]Examples
    [Collapse]Bars
      How to: Add an item to a category
      How to: Add Items to a Container Bar Item (Menu)
      How to: Add Items to Bars' Customization Menu
      How to: Change the Default Customization Form's Behavior
      How to: Change the paint style
      How to: Create a category and add a bar item to it
      How to: Create and Customize an Item and Its Item Links
      How to: Create Bars in Code
      How to: Custom Paint a Menu Bar of a Popup Menu
      How to: Custom Paint a Menu Bar of a Sub-Menu
      How to: Customize Font Settings for Specific Items
      How to: Focus a specific command within a menu
      How to: Iterate through items that belong to a specific category
      How to: Merge bars manually
      How to: Prevent an In-Place Editor from Being Activated
      How to: Prevent Specific Shortcuts from Being Processed by the BarManager
      How to: Save the layout of bars to a file
      How to: Save the layout of bars to a stream
      How to: Save the layout of bars to the system registry
    [Expand]Ribbon
    [Expand]Popup Menus
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

How to: Custom Paint a Menu Bar of a Popup Menu

The following sample code handles the PopupMenu.PaintMenuBar event. The handler fills the menu bar area with a linear gradient brush and paints "XtraBars Suite" on it.

The image below displays an example of using such a PopupMenu.PaintMenuBar event handler. (Note that the PopupMenu.MenuBarWidth property of the corresponding popup menu should be set to 20 to obtain similar output).

How would you rate this topic?​​​​​​​