Search
FlowChart.CustomDraw Event
See Also
 



Occurs when a custom-draw box is painted.

 Syntax

VB6  Copy Code

Public Event CustomDraw

 Event Data

Parameter

Type

Description

hdc

[input] device context

A HDC. Handle to the device context to draw in.

box

[input] reference to Box object

The box to be drawn.

tag

[input] long

The tag of the box.

shadow

[input] boolean

Indicates whether to draw a shadow or the box itself.

left

[input] long

The left side of the box bounding rectangle.

top

[input] long

The top side of the box bounding rectangle.

right

[input] long

The right side of the box bounding rectangle.

bottom

[input] long

The bottom side of the box bounding rectangle.

Dispatch ID: 15

 Remarks

Raised when a custom-draw box has to be painted. Separate parameters describe:

  • hdc is a handle to the window device context;
  • box is the box that must be painted;
  • tag is the custom data attached to the box, where you can store some drawing data if needed;
  • left, top, right, bottom are the box coordinates;

The hdc you get is already prepared for drawing according to document coordinate system. If draw style is cdAdditional, the clipping region is set to the box shape.

The two custom-draw styles are:

  • cdAdditional - first the box shape is drawn and filled with color, its picture is painted (if present), custom-drawing code is invoked by firing this event, and finally the box text is rendered.
  • cdFull - no standard drawing is done for the box, thus it's entirely your responsibility to draw it since only the custom drawing code is invoked.

If you need to handle this event in VB you should first cast the hdc to long:

VB  Copy Code

Dim lngHdc As Long
lngHdc = VarPtr(hdc)

Then you will be able to pass lngHdc to Windows GDI API calls.

 See Also