Solved

Changing font of a tree control item

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
either24  challenge 19 105
one notepad file content suddenly garbled.. (other notepads are OK in same folder) 3 95
Way to decrease size of apk file 9 109
Problem to App source 6 93
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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…

733 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