List box questions

I have a list box that the supervisors can select a job from. The list box is set to allow upto 10 lines of text although all the selections are only 5 line of text long. What I want to be able to do is if they click in the area where there is no text I want to clear the selected value. The problem I have right now is if they click on the area where there is no text it will select the last item in that list. I have tried using mouse clicks and also some of the code that is in the help files but so far nothing has cleared the field. Thanks for the help and have a great day.

Hitting the ESC key will clear the selection, as will running code like this (you could put this on a “Clear Selection” button)

list = event.source.parent.getComponent("List") list.selectedIndex = -1

Hope this helps,

Well I will be a sun of a gun I must be learning something. It took some doing but I finally was able to accomplish what I wanted. Not sure if it is the best way or most efficient but it works. I used a double click count then set the selected index to -1 and it seems to do the trick.

Good idea, that’ll work fine.