Welcome Guest.   Make a donation to an author on the site October 24, 2014, 10:36:49 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Check out and download the GOE 2007 Freeware Challenge productivity tools.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: Another Question: State/Selection Images in TreeView  (Read 6524 times)
fmwyso
Participant
*
Posts: 5

View Profile Give some DonationCredits to this forum member
« on: November 09, 2008, 02:14:57 PM »

 I have a TreeView (TreeView1) and an ImageList (ImageList1)... The images are all correlated correctly and everything, but my problem is that when a TreeView item is selected the "icon" changes. I would to disable or turn off that option... Just like before, I'm sure it is a small thing but State was the only one I could find and it didn't work for me ><. I also tried disabling all "masking" stuff, but that didn't work either for me ><..

 So, if you know how to disable the selection image change please tell me cheesy. If possible, I would also like to know what "masking" and "StateImages" are for?

 Thank you for your help,

    fmwyso

 (if mouser happens to be the one who answers/reads this... That is freken awesome that your getting a P.h.D (I think that's spelling) in CS. I am planning on getting my Masters... Going to comm. college next season to start my 6-10 years of pain, depending on speed of course, to get my P.h.D/Masters in CS... Only prob I have is that I'll have to start out with classes for VB X_X)
« Last Edit: November 09, 2008, 03:24:04 PM by fmwyso » Logged
fmwyso
Participant
*
Posts: 5

View Profile Give some DonationCredits to this forum member
« Reply #1 on: November 24, 2008, 06:50:39 PM »

 Hmmm... I guess no body understands my question?

 I have a TreeView with images on each item... When the item is selected, for some reason, it changes the image of that item. I want to turn that change off, does anyone know how to?
Logged
marylee
Participant
*
Posts: 4

View Profile Give some DonationCredits to this forum member
« Reply #2 on: January 27, 2009, 03:12:07 AM »

Hello you!
I have exactly the same problem, but cannot find nowhere a solution!
Could anybody help?
Or has anybody an idea how to solve it?
Thanks a lot,
marylee
Logged
app103
That scary taskbar girl
Global Moderator
*****
Posts: 5,277



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #3 on: January 27, 2009, 03:16:45 AM »

Why not just set the same image for all states?
Logged

marylee
Participant
*
Posts: 4

View Profile Give some DonationCredits to this forum member
« Reply #4 on: January 27, 2009, 03:25:46 AM »

Because I have two different kinds of images, depending on the item itself.
And I combine the image directly with the new node when creating the tree.
The image is just red and green, and is symbolizising the "status" of the item.
And this has nothing to do with the automatical status "selected/unselected"....
Logged
app103
That scary taskbar girl
Global Moderator
*****
Posts: 5,277



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #5 on: January 27, 2009, 03:27:13 AM »

Copied from Dephi 6 Help file:

Quote
TCustomTreeView.StateImages

Determines which image list to use for state images.

property StateImages: TCustomImageList;

Description

Use StateImages to provide a set of bitmaps that reflect the state of tree view nodes. The state image appears as an additional image to the left of the item's icon.

Quote
TCustomImageList is the base class for collections of same-sized images, each of which can be referred to by its index.

Unit

ImgList

Description

Image lists are used to efficiently manage large sets of icons or bitmaps. All images in an image list are contained in a single, wide bitmap in screen device format. An image list may also include a monochrome bitmap that contains masks that are combined with the images to produce a transparent effect such as is common in icons.

Logged

marylee
Participant
*
Posts: 4

View Profile Give some DonationCredits to this forum member
« Reply #6 on: January 27, 2009, 06:01:36 AM »

Hello,

I'm using treeView1.ImageList not treeView1.StateImageList. However the images change..
Logged
marylee
Participant
*
Posts: 4

View Profile Give some DonationCredits to this forum member
« Reply #7 on: January 30, 2009, 05:52:49 AM »

Ok, now I have the solution!
In the Add Method of the TreeNodes you cannot specify only the index of the image of the node, but also the image of the selectedNode!
tn.Nodes.Add("name", "Node Text", 1, 1);
 smiley
Logged
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.036s | Server load: 0.06 ]