Hi people,
I have a bit of a problem with the UltraTree. I want to create room to the left of the tree, because I want to draw an arrow in front of the currently selected node. I've tried using both the Padding and Margin properties of the tree, but they don't seem to do anything. I've set the Indent property to 0, to make the ExpansionIndicators and connecting lines disappear, but this also means I don't have any room to draw the arrow. What's the best way to achieve the spacing in front/around the tree?
Greets,
Floris
I'm glad you got it working the way you need it here. But it seems to me that it would be simpler to turn off the ExpansionIndicators and the connecting lines and then set the indentation to create the space you need.
I got it working. In case anybody else is interested here's how I did it:
I found a tool that allows me to view which UIElements are in the control you want to modify. More information can be found here: http://geekswithblogs.net/devin/archive/2005/11/17/60406.aspx
With the aid of this tool I identified which UIElements I needed to modify. I then wrote a simple CreationFilter to move everything a little bit to the left. Here's the code:
class MoveTree : IUIElementCreationFilter
{
public bool BeforeCreateChildElements(UIElement parent)
if (parent is TreeNodeUIElement)
parent.Offset(20, 0);
}
//Returning false means we don't want to intervene in the creation of child elements.
return false;
public void AfterCreateChildElements(UIElement parent)
return;