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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listbox disabled items in multi-column listbox in VFP 8 SP1 1

Status
Not open for further replies.

MichaelHawksworth

IS-IT--Management
Jun 6, 2001
27
0
0
GB
While prefixing an item with "\" disables the item (cant select it with mouse) it does not change the item to the disabled colours. Makes it a little difficult for the users.

At least as far as I can tell!

Regards

Regards

Michael Hawksworth
 
Hi
Probably you can set the DisabledItemBackColor property of the listbox to whatever you want. :)


____________________________________________
ramani - (Subramanian.G) :)
When you ask VFP questions, please add VFP version.
 
Nah that doesn't work, completely ignores it.

Regards

Regards

Michael Hawksworth
 

You may want to adjust the DisabledItemForecolor. Here ia an example.
Code:
PUBLIC oform1
oform1=NEWOBJECT("form1")
oform1.Show
RETURN
DEFINE CLASS form1 AS form
	DoCreate = .T.
	Caption = "Form1"
	Name = "Form1"
	ADD OBJECT list1 AS listbox WITH ;
		RowSourceType = 1, ;
		RowSource = "\Disabled item, Not disabled item", ;
		Height = 169, ;
		Left = 48, ;
		Top = 24, ;
		Width = 229, ;
		DisabledItemForeColor = RGB(0,255,0), ;
		Name = "List1"
ENDDEFINE

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
I have tried that.

If it has only one column it is fine if it has two or more it doesn't work.

Regards

Regards

Michael Hawksworth
 
Michael Hawksworth

If it has only one column it is fine if it has two or more it doesn't work.

Sorry, you didn't specify clearly in your original post.

Code:
PUBLIC oform1
oform1=NEWOBJECT("form1")
oform1.Show
RETURN
DEFINE CLASS form1 AS form
    DoCreate = .T.
    Caption = "Form1"
    Name = "Form1"
    ADD OBJECT list1 AS listbox WITH ;
        columncount = 2, ;
        RowSourceType = 1, ;
        RowSource = " Not disabled item 1,Not disabled item two,\Both Disabled item,\Two disabled items", ;
        Height = 169, ;
        Left = 48, ;
        Top = 24, ;
        Width = 300, ;
        DisabledItemForeColor = RGB(0,255,0), ;
        Name = "List1"
ENDDEFINE

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Thanks, much better.

To sumarise, you need to prefix all the columns with '\' not just the first one.


(P.S. Thats why the post said Multi-Column ;) )

Regards

Michael Hawksworth
 
Michael Hawksworth

Just to add to this solution, it also works for VFP5.0,VFP6.0 and VFP7.0.

Thanks for the star.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top