Treeview font and image

M

Markus Rytterkull

Hi!

I wonder if it is possible to change the font size of the
displayed text in treeview, the default size is a bit
small in my opionen. Treeview.font isn't supported in CF.

Also I changed the size of the imagelist I use for
treeview nodes and after this the +/- signs in the
treeview where minimized as well. Isn't this strange?

/ Markus
 
M

Markus Rytterkull

And also

Besides controling image size and font size, I would also
like to control the spacing between nodes. For instance,
I would like to have larger spacing between my root nodes
and smaller between child nodes.

And while I'm at it, how do I use images for root nodes
but nothing for child nodes. Right now I have a image
looking like a extension of the "---" line to the child
so that it looks like there is no picture. Which seems a
bit primitive to me.

Perhaps there is an easy solution to all of this?

What a wonderful world that would be...
/ Markus
 
C

C. Vollmer

Well, during the beta of CF I wrote that I would like the nodes, that
don't have an image, not to leave the space just blank but to align to
the left. All I got was "Works as designed", so that's it.

Christoph
 
P

Peter Foot [MVP]

This is how the underlying OS treeview works, AFAIK its the same on the
desktop too. The only way to get greater flexibility would be to write a
custom control which exposes more properties.
The Font and vertical spacing should be possible to control (globally for
the control not on a node-by-node basis) working on the basis that the
treeview control uses a native windows control internally and it should be
possible to send a message to the native control to do this.

Peter
 
S

Serg Kuryata [MS]

Hello Markus,

You can the Font and the Indent properties to set the font that is used by
the treeview and the distance to indent each of the child tree node levels.
For example,

this.treeView1.Font = new Font("Tahoma", 10, FontStyle.Regular);
this.treeView1.Indent = 30;

Unfortunately, these properties are not visible in the Designer but you can
access them from the code. Please also note that these properties affect
the entire treeview control. You cannot set them for each node separately.

Thank you,
Sergiy.

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| Content-Class: urn:content-classes:message
| From: "Markus Rytterkull" <[email protected]>
| Sender: "Markus Rytterkull" <[email protected]>
| Subject: Treeview font and image
| Date: Fri, 27 Feb 2004 03:31:12 -0800
| Lines: 11
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcP9JTQbM+5eKQVCSfuwTEaVKZZ32w==
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:47083
| NNTP-Posting-Host: tk2msftngxa12.phx.gbl 10.40.1.164
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| Hi!
|
| I wonder if it is possible to change the font size of the
| displayed text in treeview, the default size is a bit
| small in my opionen. Treeview.font isn't supported in CF.
|
| Also I changed the size of the imagelist I use for
| treeview nodes and after this the +/- signs in the
| treeview where minimized as well. Isn't this strange?
|
| / Markus
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top