Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Thu Feb 01, 2007 9:20 pm Post subject: |
|
|
To do this you'd need to create a derived RowWidget class and override the PaintDropOnIndicator, PaintDropAboveIndicator and PaintDropBelowIndicator methods. Then install the new RowWidget class by setting the VirtualTree.RowWidgetCreator delegate (or override CreateRowWidget).
The default code for these methods looks like:
Code: | protected virtual void PaintDropOnIndicator(Graphics graphics)
{
int y = Bounds.Y + (Bounds.Height - _dropOnIcon.Height) / 2;
Rectangle bounds = new Rectangle(DropIndicatorX, y, _dropOnIcon.Width, _dropOnIcon.Height);
bounds = DrawingUtilities.RtlTranslateRect(WidgetControl, bounds);
DrawingUtilities.DrawIcon(graphics, _dropOnIcon, bounds.X, bounds.Y, false, WidgetControl.RightToLeft == RightToLeft.Yes);
} |
Note you should use the DrawingUtilities method to draw the icon rather than Graphics.DrawIcon because of performance issues with the latter. _________________ Infralution Support |
|