combit List & Label 25 - .NET Online Web Help
DrawDesignerObjectHandler Delegate

combit.ListLabel25 Namespace : DrawDesignerObjectHandler Delegate

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 the graphic file selected above.

Public Delegate Sub DrawDesignerObjectHandler( _
   ByVal sender As Object, _
   ByVal e As DrawDesignerObjectEventArgs _
public delegate void DrawDesignerObjectHandler( 
   object sender,
   DrawDesignerObjectEventArgs e
public delegate void DrawDesignerObjectHandler( 
   Object^ sender,
   DrawDesignerObjectEventArgs^ e



Due to a minor inconsistency, conversion of the font size should be carried out manually at the time of printing the text using the Graphics.DrawString, if necessary. The .NET framework calculates it internally as 1/10 inch. If millimeter (1/10) has been indicated as the metric unit (property Units), the size should be multiplied manually by 2.54:

e.Graphics.DrawString("Hello world", new Font("Arial", 20F * 2.54F), new SolidBrush(Color.Black), e.ClipRectangle);


private void designerObject1_DrawDesignerObject(object sender, DrawDesignerObjectEventArgs e)


     DesignerObject desobj = (DesignerObject) sender;



          string imagefile = desobj.ObjectProperties["imagefile"].ToString();

          e.Graphics.DrawImage(new Bitmap(imagefile), e.ClipRectangle);



Platforms: Windows 7 SP1 - Windows 10 Version 1909, Windows Server 2008 R2 - 2019

See Also


DrawDesignerObjectHandler Members
combit.ListLabel25 Namespace