I have two Controls on a form, a TDBGrid and a TDBMemo both linked to the same DataSource.
When the user scrolls the DBGrid th Row with focus displays the contents of a letter in the memo. All good. I am getting complaints about an annoyance, which is actually user-failure issue, but I would like to program around it.
The user clicks the grid then moves the mouse down to the memo but does not click it, then rolls the mouse wheel to scroll the memo down. Instead of that happening, the grid still has focus so it scrolls down the list of letters. If the user first clicked in the memo, it would receive focus and the wheel would work as expected.
I tried adding
if memoLetter.Enabled then memoLetter.SetFocus;
in the OnCellClick, for the grid, but it makes the grid refresh and looks awful with the blinking.
So, how can I capture the mouse-wheel event and see if the mouse cursor is over the memo? If it is then give the memo the focus and the normal wheel scroll take over for the memo.
I found a couple of if MouseOver things online but neither worked very well.
Thanks