TreeCtrl and Images

I want to display normal and state images in my tree control from image list. 
Generally, treectrl displays checkbox first in a row and it then displays the 
normal image. Is it possible to reverse this order i.e. to show normal image 
before the state image ?
0
Utf
1/6/2010 3:44:01 PM
vc.mfc 33608 articles. 0 followers. Follow

4 Replies
1155 Views

Similar Articles

[PageSpeed] 37

On Jan 6, 10:44=A0am, shubhishubhi
<shubhishu...@discussions.microsoft.com> wrote:
> I want to display normal and state images in my tree control from image l=
ist.
> Generally, treectrl displays checkbox first in a row and it then displays=
 the
> normal image. Is it possible to reverse this order i.e. to show normal im=
age
> before the state image ?

I am not fully certain but you may be able to do it using
NM_CUSTOMDRAW.

--
Ajay
0
Ajay
1/6/2010 4:27:03 PM
Maybe something like this would work for you, or at least give you some 
ideas:

http://www.codeproject.com/KB/tree/CRHTree.aspx

Tom

"shubhishubhi" <shubhishubhi@discussions.microsoft.com> wrote in message 
news:650D2A4F-CD66-47A3-B1F5-AC64EE9BFA68@microsoft.com...
> I want to display normal and state images in my tree control from image 
> list.
> Generally, treectrl displays checkbox first in a row and it then displays 
> the
> normal image. Is it possible to reverse this order i.e. to show normal 
> image
> before the state image ? 

0
Tom
1/6/2010 6:16:33 PM
On Jan 6, 11:16=A0pm, "Tom Serface" <t...@camaswood.com> wrote:
> Maybe something like this would work for you, or at least give you some
> ideas:
>
> http://www.codeproject.com/KB/tree/CRHTree.aspx
>
> Tom
>
> "shubhishubhi" <shubhishu...@discussions.microsoft.com> wrote in message
>
> news:650D2A4F-CD66-47A3-B1F5-AC64EE9BFA68@microsoft.com...
>
> > I want to display normal and state images in my tree control from image
> > list.
> > Generally, treectrl displays checkbox first in a row and it then displa=
ys
> > the
> > normal image. Is it possible to reverse this order i.e. to show normal
> > image
> > before the state image ?
>
>

U can subclass CTreeCtrl and do your own painting for each item in
your own way
0
rahul
1/7/2010 4:50:14 AM
On Jan 6, 11:50=A0pm, rahul <hyrahu...@gmail.com> wrote:

> U can subclass CTreeCtrl and do your own painting for each item in
> your own way

Thats precisely why NM_CUSTOMDRAW was introduced. Its more structured
and lets you draw the portion of the control that you want to draw as
opposed to the painting of the whole control.

--
Ajay


0
Ajay
1/7/2010 2:54:40 PM
Reply:

Similar Artilces:

My Drag Image Flickers
Hi guys, My drag image flickers, I understand the cause of this (I think) but I don't know how to fix it. I use this to auto-scroll during a drag and drop: // in OnTimer() m_pDragImage->DragShowNolock(FALSE); SendMessage(WM_VSCROLL,MAKEWPARAM(SB_LINEDOWN,0),NULL); m_pDragImage->DragShowNolock(TRUE); So since I'm hiding it, then showing it again, it flickers. Can I fix this ? Thanks, Robert A. ...

inserting images
When inserting an image into a bound object frame I get the image name, not the actual image. I am doing this: --right-click --insert object --create from file --Browse to find the image file I have tried this with and without checkmarking the "link" option. Any help would be very appreciated- Betsy On May 7, 6:48 am, betw...@gmail.com wrote: > When inserting an image into a bound object frame I get the image > name, not the actual image. I am doing this: > > --right-click > --insert object > --create from file > --Browse to find the image file > > ...

problem with preview of .jpg image attached file
Hello The following problem began from the moment I upgraded to Snow Leopard. I use Entourage 2004 and downloaded the very latest version. Inside Entourage, when I try to open a .jpg image attached to a message, this opens Preview app but the image is not visible whatever settings adjustments I try. The image however can be seen in the right side panel of Preview (if opened). If I transfer the .jpg file to desktop or to any folder and then open it with Preview app, the image appears normally. In case of .pdf attached file, no such problem occurs. .pdf files also open with Preview...

Image
How do I take an image off a website and place it into one of my documents. Tried this by dragging but document was fuzzy and don't know how to sharpen clarity of the image. There should be a better way but don't know how. Your thoughts? Try right clicking on the image and do a "Save as...." -- Don Vancouver, USA "staceyk" <staceyk@discussions.microsoft.com> wrote in message news:FBB9076A-C02A-4DF3-947C-7620FA3C82FC@microsoft.com... > How do I take an image off a website and place it into one of my > documents. > Tried this by dragging b...

listctrl/treectrl
hi, how to sort the items displayed under a column in listctrl. pls help. thanking in advance regards mani Isn't this Function helps CListCtrl::SortItems -- cheers, Alok Gupta Visit me at http://alok.bizhat.com "Manikandan" <manikandan_r@hotmail.com> wrote in message news:eNNS8#1WFHA.796@TK2MSFTNGP09.phx.gbl... > hi, > > how to sort the items displayed under a column in > listctrl. > pls help. > thanking in advance > > regards > mani > > ...

Red "x" where image should be for images in email body
A user is unable to view images embedded in the body of emails. A red "x" appears instead of the image however when she emails that image to myself and other users, the image is there. The image is a .bmp and I have checked the security settings on the Outlook client and even uninstalled Outlook 2003 and reinstalled. Pictures are not displayed on Web sites in Internet Explorer: http://support.microsoft.com/kb/283807 Outlook-specific newsgroups include: news://msnews.microsoft.com/microsoft.public.outlook.general news://msnews.microsoft.com/microsoft.public.outlook.bcm...

TreeCtrl
Hello: I have a dialog with TreeCtrl. TreeCtrl populated as : RootNode node1 node2 node3 In Tree.cpp file i added handler to NM_CLICK. void CTree::OnClick(NMHDR* pNMHDR, LRESULT* pResult) { NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR; CString cstr, strPath; HTREEITEM hIT, hNext; hIT = this->GetSelectedItem(); strPath = this->GetItemText(hIT); MessageBox(strPath.GetBuffer(strPath.GetLength()), NULL, MB_OK); *pResult = 0; } I have the following problem: when i click on: node1 it displays text ...

strange treectrl item selection state in XP
When you click on the icon of an item in a treectrl type view initially the text of the item gets the focus and the text is reverse hilighted. Then if you click a second time the reverse-hilight goes away and is replaced by an outline box around the text. I'm not talking about in-place edit here, just clicking twice on the icon only. You can see this behavior in an explorer window by clicking slowly twice on a file icon. Ok I just went and checked on this box (w2k) and its not happening but it does on XP (sp2). So my question is: what is this second state where just the outline of the ...

How do I print a background image in Word 2007 without tile?
Whoever helps me find a solution to this is pretty darn smart. I thought this would be a piece of cake but realize now it's harder than it seems even though it should not. I made a beautiful letterhead for my company but have it in Jpeg So I decided to write a contract on it with word and paste the letterhead as a background I did some searching on how to do this, because as usual, the most simple and obvious option of doing something was not apparent in a Microsoft program :( I tried adding it as a watermark, but you only have options of 50-100-150-200 and 500% an...

TreeCtrl problem
Hi, I am Using CTreeCtrl to draw a tree control. The horizontal scrollbar that comes when a child item with a long name is inserted is a bit small and the last two characters of the longest name are not visible even when the scrollbar is dragged to the end. What could have got wrong here.......... On Nov 3, 2:53 pm, gshetty <gshett...@gmail.com> wrote: > Hi, > > I am Using CTreeCtrl to draw a tree control. The horizontal scrollbar > that comes when a child item with a long name is inserted is a bit > small and the last two characters of the longest name are not visible ...

multiline treectrl
Hello, How can I create multiline item of treectrl? Thanks MT Multiline tree ctrls can be done using custom drawing and CTreeCtrl, but are problematic if you allow the user to edit labels, and sometime scrolling is an issue. This might be a good alternative http://www.codeproject.com/treectrl/StaticTreeControl.asp AliR. "mt" <marto@vp.pl> wrote in message news:dqp3t6$ef0$1@nemesis.news.tpi.pl... > Hello, > How can I create multiline item of treectrl? > Thanks > MT Do you mean multiple selections: http://www.codeproject.com/treectrl/MultiSelect_DragImage.asp ...

How to insert 3 images into excel with aligning each positions?
Does anyone have any suggestions on how to insert 3 images into excel with aligning each positions? Please see following code for detailed description. Does anyone have any suggestions? Thanks in advance for any suggestions Eric Private Sub Worksheet_Change(ByVal Target As Range) Dim myPic As Object Dim dblTop As Double Dim dblLeft As Double Dim dblHeight As Double Dim dblWidth As Double If Target.Address = "$A$1" Then On Error Resume Next Set myPic = ActiveSheet.Pictures(1) On Error GoTo 0 If Not myPic Is Nothing Then myPic.Delete If Range(&quo...

Applying sp3 on GP9 on Image server picks "live DB" not "Image DB"
Hi, I have a snapshot of the GP9 server. So right now testing on it. The snapshot server (which I am testing on) is called Gp9v10, while the running (live) server is called Gpv9 So while the sp3 is running it will prompt me to upgrade the databases and say: Ready to begin Upgrade the following companies: .... .... .... SQL Server Info Name: Gpv9 and that is my worry. It really needs to say Gp9v10 (since I want to upgrade the databases in my test environment). How can I change the path. The ODBC connection already points to gp9v10 (ImageDB). Thanks ...

How can I add a link to an image in my signature?
Hi there, i'm trying to add a web link to an image that I have in my signature. Is this possible? Many thanks. -- drog1998 Anybody, got any ideas? -- drog1998 "drog1998" <drog1998.318e86a@outlookbanter.com> wrote in message news:drog1998.318e86a@outlookbanter.com... > i'm trying to add a web link to an image that I have in my signature. > Is this possible? It should be. What have you tried? -- Brian Tillman [MVP-Outlook] i've tried a number of things but nothing has worked. Do you know? -- drog1998 "drog1998" <drog19...

TreeCtrl on a PropertyPage
Hi, I want to draw a TreeControl on a PropertyPage and attach this propertypage to PropertySheet. I have done the following: 1) Created a property page. 2) Drap-Dropped a Tree Control on the property page. 3) Assigned a member variable "m_tree" of type "CTreeCtrl" using class wizard. 4) DDX_Control (pDX,IDC_TREE,m_tree) is also done. 5) Tried to add a item to the tree using "m_tree.InsertItem("ABC") " . 6) Added PropertyPage to PropertySheet. The code compiles and runs fine. However, the tree is not visible at all. Only the border of tree control can...

How to store an image in a xml file
Hi, Actually I would like to store an image file(bmp, gif, jpg, ...) in a XML file. So i was thinking about using a UUENCODING or a base64 and it shouldn't be difficult to do. Ex : <?xml version="1.0" ?> <resource version="0.1"> <object class="PictureBox"> <Data type="bmp">$^$^"�'$'^$"^'$�^'$�'$�'$^$'�^'$^</Data> </object> My problem is to reload this file because once I have read the UUENCODE and decoded the file I will have a full image in MEMORY. But ...

Signature image missing when reply or forward
I am using Outlook 2000 and i have created a signature for my email with an image and hyperlink which works fine for a new msg. But when I reply or forward an email the signature does not get the image, it appears as missing (outline box with X). Does anyone know whats going on? and what can I do to fix this?? Thanks, -SG You need to check the format of the message that you are replying to or forwarding. If the message is Plain Text then the graphic and hyperlink are not going to work. However if the message format is Rich Text or HTML it should work fine but HTML would be the best...

how can i view images if i'm searching for an image w/o clicking?
When I search for images and they are listed as links, is there a way to view them without having to click on them and place them or view their properties? Its the upgrade that I really don't like with 2003...it was nice to be able to see the images an choose which one I want without having to open every single one. Do you mean...Insert / Picture / From File? Try clicking...Views / Thumbnails...on the Insert Picture screen. -- John Inzer "Shari" <Shari@discussions.microsoft.com> wrote in message news:EBDD5307-1983-4F44-894D-78C5069E154F@microsoft.com... > Whe...

Conditionated visualization of an image
Hello, is it possibile to visualize an image into a cell only if the value of another cell is (for expaple) greater than 80%? Thanks Luca >Conditionated visualization of an image< ...

wrong images displayed / auto generated image names
I have been using publisher (2007) for a while now maintaining my son's website consisting of nothing but pictures. So far it has worked great. I am recently running into a problem where when I add new images, it somehow confuses the filenames (I guess) and displays older pictures from elsewhere in the site. I don't know if the problem is b/c of the quantity of images I have or what. I am aware that the images are renamed to imagexxx.jpg when published. Is there a maximum number of images that can be loaded? On a side note, I would also like to know if there is a way to allow vie...

Publisher 2003, cannot view images only picture outline/border
Microsoft Publisher 2003 only displays a picture holder (an outline or border of a picture) in a Publisher document. Other users can view the document and see the images. Read the fourth FAQ here: Why can I not see images/shapes/lines when editing my publication? http://ed.mvps.org/Static.aspx?=Publisher/FAQs -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "Rick Young" <RickYoung@discussions.microsoft.com> wrote in message news:DD4D3D35-376A-498C-8AE6-78909F500506@microsoft.com... > Microsoft Publisher 2003 onl...

money 2006 no longer runs after installing HP image zone
After installing HP image zone my Money 2006 no longer runs and I get an error saying I need to run setup to install some components. When I re-run setup it also does not complete saying it could not install certain components. I've tried uninstalling completely and then reinstalling as other posts suggest, but no luck. I'd like to know what components Money is installing toward the end of the install. The install runs most of the way and copies all its files, but toward the end it quits with the error message. Any one know what components it could be using? ...

1 image printing as 2 images
Hi I have 1 image in my excel document, when I print preview it shows 1 image only but when I print it it squashes 2 of the same image into the photo box any suggestions welcome thanks Does this condition exist when you prit the file from another computer and printer? If so, problem is with the file. if so, cut the image out fo the file save and re-open it and re-insert the image....then see if the problem is the same......if so, try using a different image as a test...if it then is ok, problem is with the image file. Vaya con Dios, Chuck, CABGx3 "working" wrote: > ...

Capturing a screen image
I frequently write material to use in my classrooms and labs where my students use Excel XP. I would like to be able to do an old-fashioned PrintScreen, but this doesn't work any more. How can I print the entire screen image in my document? Thanks, Evelyn Depending on what you want, hit printscreen button or the printscreen button in combination with Ctrl or Shift. then go to your application, such as word or excel and do edit => Paste. This should give a bitmap picture of the part of the screen you captured. Regards, Tom Ogilvy Evelyn <elplummer@prodigy.net> wrote i...

TreeCtrl and Images
I want to display normal and state images in my tree control from image list. Generally, treectrl displays checkbox first in a row and it then displays the normal image. Is it possible to reverse this order i.e. to show normal image before the state image ? On Jan 6, 10:44=A0am, shubhishubhi <shubhishu...@discussions.microsoft.com> wrote: > I want to display normal and state images in my tree control from image l= ist. > Generally, treectrl displays checkbox first in a row and it then displays= the > normal image. Is it possible to reverse this order i.e. to show ...