LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

deselect a list box cell

I've pounded for several hours and searched the forums and have come up cold.

I would like a present a list box with no cells selected. When the user selects only a cell

it highlights for 1 second and then deselects, awaiting for another user selection. 

What is the proper programmatic way of doing this. I've been using event structured code. 

0 Kudos
Message 1 of 9
(6,022 Views)

Use the Listbox value change event, and start counting time.

After a few seconds use this...

Message Edited by Pnt on 11-08-2008 08:40 AM
0 Kudos
Message 2 of 9
(6,007 Views)

I was headed it this general direction. Here is a small VI that "almost" does

what I wanted. Although notice what happens when you mouse down and move around.

I placed the system beep in the loop to listen for extra events. 

0 Kudos
Message 3 of 9
(5,981 Views)

Change the event to mouse up.

But you have to consider what will happen if the user leaves the vi or the control without releasing the mouse button.

0 Kudos
Message 4 of 9
(5,965 Views)

I did head in that direction and it was an almost.

Here is that VI. It generates events in non cell areas.

It seems what I'm looking for is what

I assumed was a seemingly basic list box function.

Generate an event for a mouse hit in a cell (only) 

 

0 Kudos
Message 5 of 9
(5,945 Views)

Ben,

 

It's true that events generated for a List Box object include the entire List Box, not just the cells. Your program is actually the most common workaround. You will need to disregard the event if the value is -1.

 

Is there a reason the program as you have it written here is not acceptable? If you ellaborate on what your program needs to do, maybe we can offer a better suggestion.

Product Support Engineer
National Instruments
0 Kudos
Message 6 of 9
(5,916 Views)

This is as close as I can get. I can't find a method to 

deselect a cell if you mouse down in a cell and move out of

the box and them mouse it. 

0 Kudos
Message 7 of 9
(5,907 Views)
The only thing i can think of, is use the timeout event, to poll and reset the Listbox
0 Kudos
Message 8 of 9
(5,891 Views)

Well I've got to get on with my projects so I'll use my best compromise.

I had no idea that what would be a simple concept would be so difficult in Labview.

The list box must be one of the top ten controls. 

With several other programming enviroments I've used, most would return an event

for mouse actions with a modifier for the pane content. 

-1   Title Bar

-2   Top Scroll arrow

-3   Botton V scroll array 

-4   V Scroll Bar

0..#   Active Cell Hit

etc, etc. 

 

Thanks All for your help 

0 Kudos
Message 9 of 9
(5,866 Views)