Click to See Complete Forum and Search --> : Listbox with Checkbox


Cakkie
February 25th, 2000, 03:21 AM
I'm writing an network application wich check wether a user is connected to the server or not. The users to check are kept in a listbox. I'm using a listbox with style set to checkboxed. When a user is online, the box is beeing checked, when he's offline, the box is unchecked. This is the part that working, now I want, when a the user doubbleclicks a listitem, anotherwindow pops up to send that user a message. The problem is not the window popping up, but the checkbox in the list beeing checked/unchecked. Is there a way to allow the user to dblclick the list, but not change the checkbox value?
Thanx

Tom Cannaerts
slisse@planetinternet.be

The best way to escape a problem, is to solve it.

Lothar Haensler
February 25th, 2000, 04:04 AM
sorry to "bother" you again with my listView suggestions :-)
You could do that using a listview instead of a listbox.
Set the "checkbox" property to true,
set listview to report mode

Now you can check the checkbox or double-click the text without side-effects.

Ravi Kiran
February 25th, 2000, 04:42 AM
When ever Lothar expresses his views about listView, i am there to say something about listbox!, well the old fahioned that i am :-)

You can use the ItemData property of each item to store the actual state. and when user double clicks it you can re check/uncheck it back, depending on the ItemData. This item data will be populated by the logic which actually verifies if the user is connected to server or not. It ofcourse requires a little code, ( and be warned that checking the items thru code invokes another _click event, so you should put static/module level flags to block recursive processing )


RK