To my knowledge... you can't. But you can fake it. And I
always say, where you can fake it.... er, uh... you can
fake it.
Set the TreeView's border to none. Add a label just above
the TreeView with the label's BackColor set to the same
as the TreeView's and turn it's border off as well. It
shouldn't be difficult to line up the Label just above
the TreeView and get it to look like it's part of the
same control. Then just wire up the label's click event
to refresh the TreeView and process anything else that
you want(like collapsing all nodes). If you want to
complete the illusion, put both the Label and TreeView on
a Panel control, set their docking and anchor properties
to extend to the edges of the panel, and turn the panel's
border property on.
It could fool even the best trained eye.
Good Luck,
Jacob
-----Original Message-----
in windows explorer, the nodes immed under the "my
computer" root nodeappear with a minimum of indenting ( the +/- square is
directlyunderneath the root node ). In the .NET TreeView
control the indentis shifted one more indent level to the right, wasting
valuablehorizontal space.
How can I instruct TreeView to indent from the root node
the same wayas windows explorer does?
thanks,
-Steve
.