Skip to content

DevExpress-Examples/how-to-use-the-customdrawitem-event-to-draw-custom-icons-inside-diagram-items-t441104

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Files to look at:

How to use the CustomDrawItem event to draw custom icons inside diagram items

This example demonstrates how to use the CustomDrawItem event to modify the standard drawing mechanism of diagram items (shapes, connectors, containers, etc.). In this example, a DiagramShape class descendant was created to introduce the Status property. Depending on the Status property value, a custom icon is drawn in the lower right-hand corner of a shape.


Important notes: The DefaultDraw method in the event args invokes certain parts of the standard shape drawing mechanism (the method parameter defines which ones). If you don't call this method, shape content, border and background will not be drawn.

To apply custom drawing logic defined in the CustomDrawItem event handler to your shapes, set the Handled property from the event args to true.