PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Compact Framework CF does not have NodeFont property for treeview control???

Reply

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

 
Thread Tools Rate Thread
Old 30-11-2006, 07:32 AM   #1
Hari
Guest
 
Posts: n/a
Default CF does not have NodeFont property for treeview control???



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

  Reply With Quote
Old 30-11-2006, 09:06 AM   #2
Peter Foot [MVP]
Guest
 
Posts: n/a
Default Re: CF does not have NodeFont property for treeview control???

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


"Hari" <hadusumalli@mantragroup.com> wrote in message
news:1164871966.202634.179220@14g2000cws.googlegroups.com...
>
> 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
>


  Reply With Quote
Old 30-11-2006, 10:12 AM   #3
Peter Foot [MVP]
Guest
 
Posts: n/a
Default Re: CF does not have NodeFont property for treeview control???

As a follow-up, I've written a post on implementing Bold items in your
TreeView:-
http://www.peterfoot.net/MakeIndivi...wNodesBold.aspx

Peter

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

"Hari" <hadusumalli@mantragroup.com> wrote in message
news:1164871966.202634.179220@14g2000cws.googlegroups.com...
>
> 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
>


  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off