Tree-view bold items

This is a discussion on Tree-view bold items within the Windows Programming forums, part of the Platform Specific Boards category; Hi everyone, I'm struggling to get bold items in my Tree-view. I'm working on a C project using the standard ...

  1. #1
    Registered User
    Join Date
    Feb 2005
    Posts
    8

    Tree-view bold items

    Hi everyone,

    I'm struggling to get bold items in my Tree-view. I'm working on a C project using the standard Windows API. The MSDN Library states that the TVIS_BOLD state would set the item to bold but apparently I couldn't get it to work.

    So far I've been trying to accomplish that with the following:

    Code:
    	
    tvitem.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_STATE;
    tvitem.stateMask = TVIS_STATEIMAGEMASK;
    tvitem.state = INDEXTOSTATEIMAGEMASK(ITEMPIC_NR) | TVIS_BOLD;
    ...
    item_handle = TreeView_InsertItem(hwndl, &tvinsert);
    I also changed the items label programmatically by using
    Code:
    TreeView_SetItem(hwnd, &tvitem);
    but this didn't help to change the item to bold.

    Any help is much appreciated. Thanks in advance.
    Manuel

  2. #2
    Registered User
    Join Date
    Feb 2005
    Posts
    8
    Or if it makes things easier:

    How do I use the TreeView_SetItem and _GetItem macros?

    MSDN states that one receives the data as supplied with the TVITEM struct pointer. But that sounds a bit unfamiliar to me that I need to preset my struct with those flags that I want to receive.

    Thanks allot.
    Manuel

  3. #3

  4. #4
    Registered User
    Join Date
    Feb 2005
    Posts
    8
    Now that was a tricky one. Who would have thought that you have to set both:

    Code:
    tvitem.mask = tvitem.mask | TVIS_BOLD;
    tvitem.stateMask = tvitem.statemask | TVIS_BOLD;
    Anyway. Thanks allot.
    Manuel

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Interpreter.c
    By moussa in forum C Programming
    Replies: 4
    Last Post: 05-28-2008, 05:59 PM
  2. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  3. Tree View control not appearing
    By Garfield in forum Windows Programming
    Replies: 1
    Last Post: 03-07-2004, 12:47 PM
  4. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 09:33 AM
  5. BST/Red and Black Tree
    By ghettoman in forum C++ Programming
    Replies: 0
    Last Post: 10-24-2001, 10:45 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21