T
timtos
I am working on a custom treeView and have some problems with
a) node.Bounds.Width
b) concatenate strings drawn with DrawString(...)
a)
I want to highlight a selected node and used the node.Bounds dimensions
to draw a rectangle around the node but the node.Bounds.Width property
seems to be wrong. Sometimes the rectangle is too large and sometimes
it is too small; something like this
selectedNo(*)de
selectedNodeselect(*)edNode
selNod(*)e
(*) = the end of the rectangle - although the node.Bounds dimensions are used.
What can that be?
b)
I want to concatenate two strings drawn with DrawString.
How do I get the exact width of such a drawn string?
Or in other words - How do I get to know where to let the second string start?
I´ve tried something like this:
int width = this.node.Font.Size * text1.Length;
But of course that isn´t working...
Any ideas about these two topics?
Thanks really a lot for any hints!
Greetings,
timtos.
a) node.Bounds.Width
b) concatenate strings drawn with DrawString(...)
a)
I want to highlight a selected node and used the node.Bounds dimensions
to draw a rectangle around the node but the node.Bounds.Width property
seems to be wrong. Sometimes the rectangle is too large and sometimes
it is too small; something like this
selectedNo(*)de
selectedNodeselect(*)edNode
selNod(*)e
(*) = the end of the rectangle - although the node.Bounds dimensions are used.
What can that be?
b)
I want to concatenate two strings drawn with DrawString.
How do I get the exact width of such a drawn string?
Or in other words - How do I get to know where to let the second string start?
I´ve tried something like this:
int width = this.node.Font.Size * text1.Length;
But of course that isn´t working...
Any ideas about these two topics?
Thanks really a lot for any hints!
Greetings,
timtos.