Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable items in a listview

Status
Not open for further replies.

INFORMAT

Programmer
Jan 3, 2001
121
BE
Hello,

Is it possible to disable items in a listview? I used the property Ghosted. In the help they say "Returns or sets a value that determines whether a ListItem object in a ListView control is unavailable (it appears dimmed)." I tried this, but it doesn't work. Is it because I don't use a image in my listview (report view - I don't need an image)?

I must disable some items of my listview. Is it possible (maybe by using other properties)?

Can somebody help me?
 
Hello there,

The ghosted property is only apparent when you use images on the listitems.

As far as I know you can still set the ghosted property without images and check this property when the item is selected but this doesn't help the user determine which items are unavailable.

I am not aware of any other properties which will disable an item in the listview.

As a last resort you could remove or not include items in the listview.

-Paul
 
You can disable an item by preceding it with a backslash.

Jim
 
Hi,

I tried to do so, but instead of disabling my item, the backslash appears in my listview and it isn't disabled. When I want to disable items in a listbox I also use the backslash. With listboxes everything works like it should, but not in a listview.

I use the following code to disable an item:
thisform.listview.selecteditem.text = "\"+alltrim(thisform.listview.selecteditem.text)

Is it right when I preceed the text property with a backslash or should I do so with the key property?

Could someone help me?

Thanks for your time and answer.

Tom Lefever
Informat cv
 
Hi!

The backslash works for native VFP listboxes.

You can try to simulate disabling programmatically by changing the color of the item in list and conditional processing of events for such colored items.
Vlad Grynchyshyn
vgryn@softserve.lviv.ua
The professional level of programmer could be determined by level of stupidity of his/her bugs
 
Hi!

I searched in the help and I didn't find a way to change the color of my items in my listview (backcolor, forecolor?). Is it possible to use dynamicbackcolor or dynamicforecolor?

Tom
Informat cv
 
Hi!

I beleive there is a way to display items in different colors. Windows Explorer displays compressed files using blue clor. It uses the same ActiveX (ListView), as far as I know. Well, I did not found these properties in the help for ListItem and Node objects. However, for Node object for TreeView control I found that BackColor and ForeColor properties are available and I can change them. I guess the same could be done for ListItem control.

If you have VFP7, you can also try AMEMBERS() function that works for ActiveX controls in VFP7 only.

Good luck!
Vlad Grynchyshyn
vgryn@softserve.lviv.ua
The professional level of programmer could be determined by level of stupidity of his/her bugs
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top