all groups > dotnet compact framework > november 2006 >
You're in the

dotnet compact framework

group:

CF does not have NodeFont property for treeview control???


CF does not have NodeFont property for treeview control??? Hari
11/29/2006 11:32:46 PM
dotnet compact framework:

Hi,

I've 2 probs with the TreeView control in CF
1) It does'nt let me change font at the node level
2) It enforces the first image in the imagelist for a node for
which the imageindex is not specified

Does any one have solutions to these?

The mainform of my app contains a treeView control. I can't have
the same font for all the nodes. I need to distinguish some nodes from
the others. Why does CF not provide NodeFont property available in
..netFramework. But i reallly need this. How can i do it on my own. Is
it possible by overriding the paint of treeView. I need to have one
mid-level node which should not have any icon displayed. Plz......
suggest.


- Hari
Re: CF does not have NodeFont property for treeview control??? Peter Foot [MVP]
11/30/2006 9:06:39 AM
Regarding the Icon, you can have a blank icon in your ImageList to use with
default nodes. The control doesn't support different fonts for different
nodes. I believe this is a limitation of the Windows CE control, not the
..NETCF wrapper. The only exception is that it is possible in the native
control to mark specific nodes as Bold. Therefore it's possible to do this
with a bit of interop code. In psuedo code you'll need to:-

Get native window handle of treeview control
Get the handle to the specific node
Send a TVM_SETITEM message to the window passing a valid TVITEM struct (see
the SDK documentation for details)

Repeat for each node you want to make bold

Peter

--
Peter Foot
Device Application Development MVP
www.peterfoot.net | www.inthehand.com


[quoted text, click to view]
Re: CF does not have NodeFont property for treeview control??? Peter Foot [MVP]
11/30/2006 10:12:19 AM
As a follow-up, I've written a post on implementing Bold items in your
TreeView:-
http://www.peterfoot.net/MakeIndividualTreeViewNodesBold.aspx

Peter

--
Peter Foot
Device Application Development MVP
www.peterfoot.net | www.inthehand.com

[quoted text, click to view]
AddThis Social Bookmark Button