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

  • Thread starter Thread starter Hari
  • Start date Start date
H

Hari

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
 
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
 
Back
Top