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!

listbox behavour

Status
Not open for further replies.

Nifrabar

Programmer
Mar 16, 2003
1,343
NL
On a form I have a listbox for multi items selection.

Q:
I use the listbox to get selections but also have some loose checkboxes which I need for the final selection.

Is there a way to prevent from loosing the selections once another control gets focus or must I make a workaround eg with grid having checkboxes on it iso listbox?

TIA
-Bart
 
Hi Bart,

Have I understood your question correctly?

The user makes a multi-selection in the listbox, and then does things in other controls. You want to find out what items were selected in the listbox, but you want to do that after the user has visited the other controls. Is that right?

If so, this shouldn't be a problem. Just refer to the listbox's Selected property as usual to determine which items were selected.

Does that not work for you?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
I agree, and don't see how a multiselect listbox loses it's selections just because the user focuses other controls. Either you talk about setting focus back to the listbox, but that on it's own also doesn't unselect the selections, or you do something, eg change the items of the listbox and that makes it loose the selections.

Bye, Olaf.
 
Hi

Mike: correct interpretation.

By saying : loosing the selections I meant the visual thing.
Could that remain visible once setting focus toanother control?

-Bart
 
Mike,

I made a mistake.
Next to the listbox a put a checkbox with in clickmethod: thisform.lstSelectie.ListItemID = 0
Thisway I could deselect all items from the listbox.
Than I needed some more checkboxes and just copied that first one with, of course, the 'reset' code.

Just feel now a bit...:~/

-Bart

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top