I have a 5 column listbox (LB1) populated with data from a sqlite database. When the user clicks on a row, further information is displayed in another listbox (LB2), using relational links to a second database.
This all works ok, but there is one thing I want to change. When the user clicks on a row in LB1, the additional data is loaded into LB2, but the cell clicked on in LB1 becomes editable, and has a blue border and pale blue background.
I have stopped the whole row in LB1 being highlighted by using me.ListIndex = -1 in the Change event of LB1, but this doesn’t stop the blue border etc on the clicked cell.
Can someone please help! I’ve searched for hours looking for the answer but without success!!
Also, a very strange thing happens when, having clicked on a row in LB1, I click on a different row in LB1. Before I release the mouse (i.e MouseDown) the additional data for the first row in LB1 appears in LB2, and then when I release the mouse (MouseUp) the data in LB2 changes to the correct data for the row selected in LB1. It’s always the info derived from whatever is in the first row of LB1 that appears initially in LB2, even if I have sorted LB1 on a different column - different info then appears in LB2 on MouseDown, to be replaced by the correct data in LB2 on MouseUp.
I have no Mouse up or down or anything else in the code!
What you see is your Cell text is selected and the Edited Cell have the focus.
These are standard computer usage (User Interface feedback).
To remove the Cell Focus, you can find the answer in this forum. But here you are:
Sub CellGotFocus(row as Integer, column as Integer)
// Remove the Cell Focus Ring in Edit Mode
Me.ActiveCell.UseFocusRing = False
End Sub
In other words:
a. Add a new Event to your ListBox: CellGotFocus
b. Put the code below into it:
// Remove the Cell Focus Ring in Edit Mode
Me.ActiveCell.UseFocusRing = False
And for the text selection, it is more complex; you have to use your own TextField instead of the one embedded in the ListBox and who is used at Cell Edit Time (.SelStart and .SelLength are not implemented there).