Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Cetin Basoz
  Where is Cetin Basoz?
 Izmir
 Turkey
 Cetin Basoz
 To: Samir H.
  Where is Samir H.?
 Yogyakarta
 Indonesia
 Samir H.
 Tags
Subject: RE: Show disabled Listbox item?
Thread ID: 268754 Message ID: 268770 # Views: 39 # Ratings: 0
Version: Visual FoxPro 9 Category: Forms
Date: Wednesday, July 14, 2010 2:23:27 PM         
   


> >
> > Samir,
> > As far as I know you have started to do these listboxes recently so it is not late for you to switch. Use a grid instead. A grid can do anything a listbox can plus it can do more. My .002 cents.
> >
> > Cetin Basoz
> >
> > .Net has got better.Think about moving - check my blog:
> > Blog (main)
> > Blog (mirror)
>
> What you say makes me down. I just changed from a grid to a listbox 3 days ago, and worked almost non stop to make this form work good.
> The list is only here to select a student and edit some notes. During note editing, I disable the list so the user can't change the student whose notes he's editing. I think I'll keep the list for the moment.
> Would you know a way to highlight the selected item?
>
> Regards
> Samir

Yes of course I do. Use a grid:) With a listbox maybe instead you may try to add a picture to show current.

Public oForm
oForm = Createobject("sampleform")
oForm.Show()

Define Class sampleform As Form
Add Object lst As ListBox With RowSourceType=3, ;
rowsource='select * from (_samples+"data\customer") into cursor xx nofilter'

Add Object btns As CommandGroup With ;
Left = 200, Top = 40,;
buttoncount=2,;
autosize = .T.,;
command1.Caption="Disable",;
command2.Caption ="Enable"

Procedure lst.Enabled_assign
Lparameters vNewval

This.Picture( This.ListIndex ) = Iif(m.vNewval Or This.ListIndex = 0, "", ;
"C:\Program Files\Microsoft Visual FoxPro 9\Graphics\Icons\Arrows\point04.ICO")
This.Enabled = m.vNewval
Endproc

Procedure btns.Click
Thisform.lst.Enabled = (This.Value = 2)
Endproc
Enddefine


But did I tell you to use a grid instead:)

Cetin Basoz

.Net has got better.Think about moving - check my blog:
Blog (main)
Blog (mirror)

ENTIRE THREAD

Show disabled Listbox item? Posted by Samir H. @ 7/14/2010 11:50:44 AM
RE: Show disabled Listbox item? Posted by Cetin Basoz @ 7/14/2010 11:53:49 AM
RE: Show disabled Listbox item? Posted by Samir H. @ 7/14/2010 12:22:35 PM
RE: Show disabled Listbox item? Posted by Jun Tangunan @ 7/14/2010 12:29:42 PM
RE: Show disabled Listbox item? Posted by tushar @ 7/14/2010 12:52:56 PM
RE: Show disabled Listbox item? Posted by Samir H. @ 7/14/2010 12:56:12 PM
RE: Show disabled Listbox item? Posted by Cetin Basoz @ 7/14/2010 2:23:27 PM
RE: Show disabled Listbox item? Posted by Samir H. @ 7/14/2010 2:59:41 PM
RE: Show disabled Listbox item? Posted by Cetin Basoz @ 7/14/2010 3:28:07 PM
RE: Show disabled Listbox item? Posted by Tamar Granor @ 7/14/2010 10:27:52 PM
RE: Show disabled Listbox item? Posted by Samir H. @ 7/15/2010 4:05:24 AM
RE: Show disabled Listbox item? Posted by Koen Piller @ 7/14/2010 10:43:05 PM
RE: Show disabled Listbox item? Posted by Samir H. @ 7/15/2010 4:42:23 AM
RE: Show disabled Listbox item? Posted by Koen Piller @ 7/16/2010 12:43:41 AM
RE: Show disabled Listbox item? Posted by Tamar Granor @ 7/14/2010 10:29:15 PM
RE: Show disabled Listbox item? Posted by Samir H. @ 7/15/2010 4:11:40 AM
RE: Show disabled Listbox item? Posted by Tamar Granor @ 7/15/2010 10:42:33 PM