Solved

Changing font of a tree control item

Posted on 1998-12-30
2
407 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
2 Comments
 

Author Comment

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

Accepted Solution

by:
dd_b earned 50 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Login Script to Copy Folders 12 22
Web browser fonts have gone wild. 8 107
notReplace  challenge 53 102
Doc'in system (example?) BA 7 79
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

760 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now