Set Scrollbar position leads to infinite loop if not visible
Original Reporter info from Mantis: LordTiberius
-
Reporter name:
Original Reporter info from Mantis: LordTiberius
- Reporter name:
Description:
If a ScrollBox is placed on the form, but hidden (e.g. if in an inactive tab on a PageControl) and if the position of the (horizontal) scroll bar should be changed by the .Position-property, an infinite loop is entered:
- FControl.ScrollBy() [l.80 controlscrollbar.inc]
-> ScrollBy_WS() [l.251 scrollingwincontrol.inc]
-> ScrollBy() [l.6142 wincontrol.inc]
Steps to reproduce:
- Place a TPageControl on a form
- Add two tabs
- Place a ScrollBox with a content wider than the scrollbox itself to Tab2
- Place a button on the form
- OnClick: ScrollBox.HorzScrollBar.Position := 0
- Compile and run
- Switch to Tab2
- Set the scrollbar of the ScrollBox to another position than 0
- Switch to Tab1 in order to make the scrollbox invisible
- Press Button