Activity custom drawing does not work

Hi,

I have written the custom activity code shown below. It should show a red line drawn across the activity rectangle. However, the line is not drawn. The activity appears as a white rectangle.

Can someone please explain how I can completely control the drawing of my activities? I have looked at the WorkflowDesignerControl example from MSDN. It seems to also do no more than overwriting the Paint event.

Regards, Mario

[Designer(typeof(PanedActivityDesigner),typeof(IDesigner))]

publicclassPanedActivity : System.Workflow.ComponentModel.Activity

{

}

publicclassPanedActivityDesigner : System.Workflow.ComponentModel.Design.ActivityDesigner

{

protectedoverridevoid OnPaint(ActivityDesignerPaintEventArgs e)

{

Pen p =newPen(Color.Red);

e.Graphics.DrawLine(p,newPoint(0, 0),newPoint(30, 20));

}

}

[3314 byte] By [mario.muja] at [2007-12-23]
# 1
You need to use x and y coords relative to the ActivityDesignerPaintEventArgs.ClipRectangle - not 0,0.
JonFlanders at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...

Software Development for Windows Vista

Site Classified