PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Noble D. Bell on December 16, 2007, 06:33:09 PM

Title: Listbox single click
Post by: Noble D. Bell on December 16, 2007, 06:33:09 PM
I am sure this has been answered here before but I cannot seem to find it.

I have a listbox control and I want the user to be able to select an item in the list by clicking on it one time. I would like for the selection rectangle to remain so that the user knows which one they selected. Right now the "blue" selection rectangle flashes when the user clicks on the item and then goes away.

Anybody point me in the right direction on this one?

nb
Title: Re: Listbox single click
Post by: TechSupport on December 16, 2007, 07:21:47 PM
You must be doing something in the LBN_SELCHANGE message for the ListBox that is causing the focus to change to another control or set the selected listbox item to null ? Normal operation of the ListBox would dictate that the ListBox selected item will stay highlighted.
Title: Re: Listbox single click
Post by: Noble D. Bell on December 16, 2007, 08:51:48 PM
You are right, once again!!

:-[  I put code in the WM_COMMAND section to load the list box with filenames from a directory. That was the problem. I moved the code to the WM_CREATE event and everything is back to normal. In looking back, I assume that if you are going to perform any startup code like loading listboxes or controls with initial values that you do not do it in the WM_COMMAND event??

nb
Title: Re: Listbox single click
Post by: TechSupport on December 16, 2007, 09:13:09 PM
Quote from: Noble D. Bell on December 16, 2007, 08:51:48 PM
In looking back, I assume that if you are going to perform any startup code like loading listboxes or controls with initial values that you do not do it in the WM_COMMAND event??

That's right - use the WM_CREATE message to do any initializations. The controls exist at that point but are not yet shown on the screen.