6/13/2023 0 Comments Delphi 7 listbox selected itemand simulate a mouse click on it so the selected table gets displayed calculate the index of the item to select įunction DoMouseWheel(_Shift: TShiftState _WheelDelta: Integer _MousePos: TPoint): Boolean override įunction TListBox.DoMouseWheel(_Shift: TShiftState _WheelDelta: Integer _MousePos: TPoint): Boolean / next/previous item as if the user pressed the up/down arrow key. / Rather than scroll the view without affecting the selected item, select the / Overrides the default behaviour of the TListbox for mouse wheel scrolling: I resorted to a proven hack and created an interposer class that overrides TListBox.DoMouseWheel: Unfortunately a listbox does not have an OnMouseWheel event (a dbtable does have one), so I could not simply assign an event handler and be done with it. I wanted it to have the same effect as on the dbtable, that is: Select the next/previous line. Of course this does not have any effect if all items are already visible.īut that wasn’t what I wanted the mouse wheel to do. ![]() The default behaviour is to scroll only the view without changing the currently selected item. The listbox contained only a few items so it didn’t have a vertical scroll bar. It turned out to be a misconception on my side: While working on my dzMdbViewer I wondered why the mouse wheel didn’t seem to scroll the listbox containing the table names but did work in the dbtable.
0 Comments
Leave a Reply. |