[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Changing font of a tree control item

Posted on 1998-12-30
2
Medium Priority
?
415 Views
Last Modified: 2013-12-03
Pretty basic question but I just started learning a few days ago and I don't have a book or any source of help besides the .hlp files vc++ 5.0 came with, so be nice :)  Ok, I created and added an item my tree control, but not how can I use SetItem() to change the font of the item to bold?  For example, I have this:

HTREEITEM a = m_tree.InsertItem(title, TVI_ROOT, TVI_LAST);

with m_tree and titled taken care of.  Now, if I want to turn that item bold I do something along the lines of this (help me - fill in the ?s and make any needed corrections please =), oh and btw, I dont have images on the tree):

m_tree.SetItem(a, TVIF_STATE, title, 0?, 0?, TVIS_BOLD?, TVIS_BOLD?, ?)

I would really appreciate help with this.  Thanks alot,

-Chris
0
Comment
Question by:core123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Author Comment

by:core123
ID: 1327039
Edited text of question
0
 
LVL 1

Accepted Solution

by:
dd_b earned 150 total points
ID: 1327040
Dear core123,

I also faced the same problem , here r some clue.

1)
what u can do is - get the window handle of your control in your intiDialog or OnInitialUpdate & then u can send following message

An application sends a WM_SETFONT message to specify the font that a control is to use when drawing text.

WM_SETFONT
wParam = (WPARAM) hfont;            // handle of font
lParam = MAKELPARAM(fRedraw, 0);    // redraw flag

2) with control window handle invoke this function

CWnd::SetFont

void SetFont( CFont* pFont, BOOL bRedraw = TRUE );

All the best

dd_b
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question