Bolding or Hilighting node in a CTreeCtrl

I am looking for a way of of bolding, hilighting, or changing the text
color for one specific node in a CTreeCtrl.  Is this possible?  If so,
how?

0
3/6/2006 6:00:31 PM
vc.mfc 33608 articles. 0 followers. Follow

6 Replies
830 Views

Similar Articles

[PageSpeed] 3

You have use an owner draw tree control.

Look in here for one:
http://www.codeproject.com/treectrl/#Custom+Tree+Controls

This one looks useful
http://www.codeproject.com/treectrl/colortreectrl.asp

AliR.

<mr.porteiro.head@gmail.com> wrote in message
news:1141668031.681508.117640@u72g2000cwu.googlegroups.com...
> I am looking for a way of of bolding, hilighting, or changing the text
> color for one specific node in a CTreeCtrl.  Is this possible?  If so,
> how?
>


0
AliR3470 (3235)
3/6/2006 6:03:23 PM
OK, so I need to use a custom tree control.  Unfortunately, all of the
examples I can find are done with dialogs.  In a CTreeView, how do I
replace the CTreeCtrl with a custom tree control?

0
bobnotbob (10)
3/6/2006 7:28:16 PM
A treecontrol responds to NM_CUSTOMDRAW. That will allow you to change
the font etc of each individual item. You dont need to do any owner
draw if you use customdraw. However 2nd link provided by Ali will do
what you want and will save you plenty of work.

-----------
Ajay Kalra
ajaykalra@yahoo.com

0
ajaykalra (6842)
3/6/2006 7:33:24 PM
That's exactly what I'm trying to do -- use the custom tree control
from the link that Ali provided in a CTreeView instead of a dialog.  I
don't know how to do that.

Also, I see that I was logged in under a different name when I started
this thread.  I am the same person as bobnotbob.  Sorry for any
confusion.

0
bobnotbob (10)
3/6/2006 7:44:22 PM
Everything is the same.  Takeover the NM_CUSTOMDRAW in your Derived
CTreeView class.

AliR.


"bobnotbob" <bobnotbob@comcast.net> wrote in message
news:1141673296.776560.220690@j52g2000cwj.googlegroups.com...
> OK, so I need to use a custom tree control.  Unfortunately, all of the
> examples I can find are done with dialogs.  In a CTreeView, how do I
> replace the CTreeCtrl with a custom tree control?
>


0
AliR3470 (3235)
3/6/2006 8:26:12 PM
There is no real difference between CTreeView and  CTreeCtrl as far as
you are concerned. You will need to derived a class from CTreeCtrl
instead of CTreeView and handle all messages the same way as in the
sample. I have not used the sample so I dont know the details. Keep in
mind that CTreeView wraps a CTreeCtrl in a view. Both have the same
window procedure.

----------
Ajay Kalra
ajaykalra@yahoo.com

0
ajaykalra (6842)
3/6/2006 8:27:26 PM
Reply:

Similar Artilces:

CTreeCtrl's number of selected items
Hi, To know how many iterms are currently selected in CTreeCtrl, is loopint thru its items and checking each item's selected state the only way? I wonder CTreeCtrl has a simple function to do this? Please help. Thanks. Tony The answer is 1 or 0. Tree controls can only be single select. Jase "May Young" <tony@srac.com> wrote in message news:406CA2F1.7040401@srac.com... > Hi, > > To know how many iterms are currently selected in CTreeCtrl, is loopint > thru its items and checking each item's selected state the only way? I > wonder CTreeCtrl has ...

Bold text appears in print preview but does not print bold
I am working on a menu in Publisher. In print preview, all text in bold appears bold, but when I actually print, portions of the bold text does not print in bold. This problem applies to all text within specific text boxes. For some text boxes the bold prints and for some it doesn't. Any suggestions would be enormously appreciated. What version Publisher? Don't know if that makes a difference however. If you look in the font directory in the control panel you will see a separate font for bold, italic, condensed and so on for fonts like Times New Roman and Arial. If you use ...

Have Node want Element
I am cycling through a NodeList and find the node I want. How do I turn this into a node element so I can set the attributes to the values I need. Thanks in advance. Scot Do a type-cast. Examples assumes that the Node is in the variable oNode. C# XmlElement oElement = (XmlElement) oNode; VB6 Dim oElement as IXMLDOMElement Set oElement = oNode /Magus >-----Original Message----- >I am cycling through a NodeList and find the node I >want. How do I turn this into a node element so I can >set the attributes to the values I need. > >Thanks in advance. >Scot >. &g...

Double-click for bold
Is there a way to attach a particular formatting command to double-click, rather than it editing the cell's contents? For instance, emboldening a row/column/cell just by double-clicking it? No but you can use the "paintbrush" tool : 1) Select a cell which is in the format (border / font / ...) you want to use. 2) Double-click on the paintbrush tool. 3) every cell or cell-group you select from now on will have this style applied to it. 4) when you are finished, click once on the paintbrush tool. > Is there a way to attach a particular formatting command to > double-cli...

Create node if it doesn't exist
Hi, My boss wanted me to create a VB.NET function that does the following: 1. Read the value of a specified node 2. If the node does not exist, create it with the supplied default value So the function would look something like this: Public Function ReadXML(ByVal XmlPath As String, ByVal NodePath As String, Optional ByVal DefaultValue As String) As String What's the best way to go about doing this? Using the example ReadXML("C:\My.xml","Hello/World/How/Are/You","Fine"): 1. If the file does not exist, create it (e.g. ReadXML("C: \M...

Bolding text
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) This is such a fundamental function that I can't believe I'm asking a question about it. However, every time I try to bold or italicize certain words in my document, Word makes changes to the entire document. For example, I highlight two words in a section header, hit 'Bold' on my toolbox, and the everything is bolded. Has anyone else had this problem? Can you help? Thanks! Annie Hi Annie, With the cursor in a problematic word, click on Format | Style. Click Modify. UNCHECK automatically update, and CHECK add to temp...

Retrieving JUST text from a node with child nodes
Hi all, Can't seem to figure out how to retrieve the text of a node with multiple child nodes (and I just want the text of the parent, not the InnerText or InnerXML that comes with it). My doc looks something like this: <parent attrib1 attrib2 attrib3> Extractable string <child> some more text </child> <child> yet more text </child> </parent> What's the best way to return "Extractable string"? You can either just select the text via an XPath expression like this: /parent/text() or, if your XmlD...

Bold the query based distribution lists in GAL
Just curious if anyone knows of a way to make the query based distribution lists appear bold in the GAL? Since our GAL contains query based lists and 'static' lists I would like all of them to appear in bold if possible. TIA! On Tue, 27 Dec 2005 13:10:23 -0800, "Papa" <Papa@discussions.microsoft.com> wrote: >Just curious if anyone knows of a way to make the query based distribution >lists appear bold in the GAL? Since our GAL contains query based lists and >'static' lists I would like all of them to appear in bold if possible. > >TIA! I d...

SelectNodes return all nodes when namespace is defined
I have this Xml file, bookstore.xml <Bookstore xmlns="http://www.book.com"> <Shelve index="1"> <Book name="Da Vinci Code" /> </Shelve> <Shelve index="2"> <Book name="The Holy Grail" /> </Shelve> <Shelve index="3"> <Book name="The Pragmatic Programmer" /> </Shelve> </Bookstore> When I run this code XmlDocument doc = new XmlDocument(); doc.Load(@"c:\temp\bookstore.xml"); XmlNamespaceManager nsm = new X...

bold
Hello, Everytime I try to compose a new message in outlook professional 2003, my signature is bolded. I have looked into my font settings for my signature and they are set to regular formatting. Also, I have checked my general settings for my new and other e-mails and nothing is set to bold. This is a brand new problem. I have been using outlook for years and have never had this happen until today. I'm mistified. ...

Bold part of the text field?
Hi, I design a contract report from a query. The report runs very well except that I cannot bold part of the text field (eg I have the following in the control source of an unbound text > "...with the contract value of " & [ContractCost]. I want to bold the contract value... How can I do this in Access 2003 SF See: http://www.lebans.com/mixbold-plain.htm (BTW, you can do this very simply in Access 2007.) -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at...

Set CTreeCtrl item Data
I'm reading xml file with following structure <Root> <tagName Title="" value=""/> </Root> when I build the tree items i set the title as Node Text , what I need how to set value as Item Data i tried using following code but the function need the data as DWORD where I'm getting the value as CString HTREEITEM hItem = NULL; ....... hItem = m_tree.InsertItem(xml.GetChildData(),img,imgSell,hParent); m_tree.InsertItem(xml.GetChildAttrib("Title"),3,4,hItem); m_tree.SetItemData(hItem,/*My Problem here what should i do to set the value*/...

Adding newline hex character to XmlText node in XmlDocument
When I create a XmlText node containing the new line hex character " " it is masked to "&#xa;" when I save the document object to a file. I guess this is due to the fact that the "&" character is reserved. How can I write a "&#xa;"? Thanks in advance for your help, Fabian Fabian wrote: > When I create a XmlText node containing the new line hex character " > " it is > masked to "&#xa;" when I save the document object to a file. I guess this is > due to the fact that the "&" character is ...

Printing in excel always comes out in bold even tho bold not on
When I print in excel my work always comes out in bold even though the bold is not switched on. Any suggestions?? It could be a printer setting. Does it print in bold from other applications? Regards, Fred "Scarlett50" <Scarlett50@discussions.microsoft.com> wrote in message news:DF3BAEA1-4D22-449E-BB8F-31DD8855AF20@microsoft.com... > When I print in excel my work always comes out in bold even though the > bold > is not switched on. Any suggestions?? No only when I have to type a report in excel - the actual report is ok on other computers! but...

Node(s) for Loding Credit Card info using eConnect?
We use the "Payables Transaction Entry" & "Payables Transaction Entry Distribution" screens to load Credit Card data. We can get the data in a spreadsheet and wish to load them directly using eConnect. Can someone point me to the node or nodes for loading this Credit Card data into GP 9.0 using eConnect? DavidM: If you are looking to populate credit card type of information on a payment right on the invoice - you would look at these fields in the taPMTransactionInsert procedure: @I_vCRCRDAMT - the credit card amount @I_vCCAMPYNM - the credit card payment number...

Cannot see SQL Server 2008 on other node!
I have visual studio 2008 installed on my home workstation and visual studio 2010 on my notebook computer issued to me by my employer. For some reason, my employer did not install sql server on the notebook. I have the developers version of SQL Server 2005 installed on my workstation and it seems to work fine when I specify "(local)" when developing data base applications on visual studio 2008. Now should I not be able to use the SQL server on my workstation to write database applications on my notebook computer? What do I specify in the visual studio 2010 on the no...

bold holidays number
how do i get my holidays to show in bold numbers Where? Date Navigator? Outlook Calendar? What version of Outlook? --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the (insert latest virus name here) virus, all mail sent to my personal account will be deleted without reading. After searching google.groups.com and finding no answer, bryant asked: | how do i get my holidays to show in bold numbers ...

Bold Font vs NOT Bold Font
I have an Access Application that prints labels for medical devices. I am printing the Greek Symbol "Capital O with a Slash" (Ø) using Arial Unicode MS, 14 pt. (Symbol commonly used for diameter.) Not Bold. I have also set the font weight to Very Light or Thin as an experiment. Right next to it (In a different control), is the number 10, Using Arial, 14 pt. Bold. Next to that in a different control also is "mm", using Arial 10 pt. NOT bold. Looks fine in print preview. However, when I print it on any of my 4 printers, the Greek Symbol appea...

Outlook Text Defaults to Bold
One of my users reports that when she writes an email message (either creating a new one or replying) her body text is defaulting to bold. Her signature is affected as well. Essentially, the text she wants bold is regular and the text she wants regular is bold. I checked her options and the fonts were all set to regular and the 'Always Use My Fonts' box was checked. She does not have any stationery selected. I tried to finesse the system by setting her fonts to bold (and restarting Outloook), with no change. On messages, the 'B' key on the toolbar is highlighted. If she c...

Node/Tag Finite State Machine
How would I illustrate a finite state machine that checks that each start node/tag in an XML document has a corresponding end tag (ignoring nested tags of the same type and assuming that there is only a finite set of tags)? ...

Show results in bold if a cell is in bold
Good morning, I have this sheet with some data and other one with results. The results are calculated with hlookup from the data. Data that changes weekly are introduced in bold. Is there any chance to show the results of the data in bold in bold as well. I mean, if the data is in bold, resulta must be in bold. If data is without format, must show without any format. I supposed we would need to use a macro. Is it possible? Thank you so much for you support Formulas don't bring back formatting. But maybe you could use a helper cell in the original worksheet that shows if th...

How can i set the style of a CTreeCtrl within a CTreeView ?
Im using a MFC CTreeView which fits nicely with what im trying to do. I need to change the style of the nested CTreeCtrl. There is no easy way to do this, the documentation points to using SetWindowLong. void CMyTreeView::OnInitialUpdate() { CTreeView::OnInitialUpdate(); CTreeCtrl& tree = GetTreeCtrl(); HTREEITEM root_item = tree.InsertItem(CString("MyProject")); HTREEITEM init_request = tree.InsertItem(CString("Item 1"), root_item); HTREEITEM doc_package = tree.InsertItem(CString("Item 2"), root_item); ASSERT(tree.GetSafeHwnd() != NULL ); ::Set...

how to sort list, bolded items from no bolded?
I'm wondering how to sort a list that has some items bolded and some not. I need to know how to sort bolded items from non-bolded for a chart or table comparison. Customers that inquired about services are all listed. Then if the customers funds/buys a service, we bold their name, etc. I want to know how to sort for comparison sake. Thank you for any information. Formatting (bold, color, etc.) should not be used to store information. It should be used for presentation only. Excel isn't set up to operate on it. It can be done with macros, if you want to do it that way. Read ...

Add to an XML node
I have a web service that returns me an XmlNode ojbect. Here is an example of the outerXML: <?xml version="1.0" encoding="utf-8" ?> <NewDataSet> <Table> <ID>123</ID> <TheName>Bob<TheName> </Table <Table> <ID>124</ID> <TheName>Barry<TheName> </Table <Table> <ID>125</ID> <TheName>Beth<TheName> </Table <Table> <ID>126</ID> <TheName>Beatrix<TheName> </Table <Table> <ID>127</ID> <TheName...

CTreeCtrl Drag and Drop example
I'm trying to implement a drag & drop operation in a CTreeCtrl. It would be extremely useful to have an example of C++ code that does all of the operations needed to accomplish the task. Is there a good one around??? Thanks, Neil Tons of examples on that subject in here http://www.codeguru.com/cpp/controls/treeview/ AliR. "Neil B" <NeilB@discussions.microsoft.com> wrote in message news:D5FF8B60-FDCF-4C92-A597-D15ACD3B6586@microsoft.com... > I'm trying to implement a drag & drop operation in a CTreeCtrl. It would > be > extremely useful to have ...