combit List & Label 30 - .NET Help
combit.Reporting Namespace / DesignerObject Class / DrawDesignerObject Event


DrawDesignerObject Event

After the user has edited the object, you are asked by List & Label to draw the object. The event DrawDesignerObject is triggered for this purpose. A Graphics object and the rectangle of the object are passed through EventArguments. Now, you can draw in the work area with the known GDI + methods. While doing so, access to the underlying object properties is naturally possible and useful. The sample listing shows the presentation of graphic file selected above.

Syntax
'Declaration
 
Public Event DrawDesignerObject As DrawDesignerObjectHandler
 
Event Data

The event handler receives an argument of type DrawDesignerObjectEventArgs containing data related to this event. The following DrawDesignerObjectEventArgs properties provide information specific to this event.

PropertyDescription

Rectangle of the object.

 

Graphics object of the designer object. You can draw in the work space using the usual GDI + methods.

 
Returns 'true' if the view in the Designer is 'Layout' or 'Layout Preview'. You can control if only the first page of the Designer object has to be drawn in design mode. If 'false' is returned, it means that you are in print mode and drawing has to be made for the complete Designer object.  
With this property List & Label is notified that no further data for the Designer object is available for printing and that List & Label is not asking for them anymore by DrawDesignerObject or GetFieldHeightInformation.  
Example
private void designerObject1_DrawDesignerObject(object sender, DrawDesignerObjectEventArgs e)
{
     DesignerObject desobj = (DesignerObject) sender;
     if(desobj.ObjectProperties.Contains("imagefile"))
     {
          string imagefile = desobj.ObjectProperties["imagefile"].ToString();
          e.Graphics.DrawImage(new Bitmap(imagefile), e.ClipRectangle);
     }
} 
Requirements

Platforms: Windows 10 (Version 21H2 - 23H2), Windows 11 (21H2 - 22H2), Windows Server 2016 - 2022
.NET: .NET Framework 4.8, .NET 6, .NET 8, .NET 9

See Also