Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Is it possible to change the icons for drag and drop action

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support
View previous topic :: View next topic  
Author Message
TesterMW



Joined: 01 Feb 2007
Posts: 1

PostPosted: Thu Feb 01, 2007 4:45 pm    Post subject: Is it possible to change the icons for drag and drop action Reply with quote

Hi!

Is it possible to change the icons for drag and drop actions?
Especially the yellow arrow icons?



Thanks

M.
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Thu Feb 01, 2007 9:20 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group