Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
None
-
None
Description
Testcase attached.
Bug description:
In ReactOS the RichEdit control is showing a vertical scrollbar even if the RichEdit control is empty. This doesn't happen in Windows.
Possible reason of this bug:
Right now ReactOS RichEdit control will always show Horizontal and/or Vertical scrollbars, even if the content fits the window, when WS_HSCROLL and/or WS_VSCROLL are applied.
Applying WS_HSCROLL and WS_VSCROLL to a RichEdit control does not force in Windows to show its scrollbars always. In Windows, scrollbars in RichEdit are "intelligent" and if the content fits the Client area the scrollbars are not shown even if these WS_(H|V)SCROLL styles are applied. If you want to "force" the scrollbars to be shown always in a RichEdit control you have to add an extra style: ES_DISABLENOSCROLL.
Offending code in the testcase:
hEdit=CreateWindow("RichEdit", "", WS_CHILD | WS_VISIBLE | WS_BORDER |ES_MULTILINE | WS_VSCROLL | ES_AUTOVSCROLL | ES_NOHIDESEL, ....)
This WS_VSCROLL seems to be enforcing in ReactOS to paint the Vertical Scrollbar always. Showing vertical scrollbar always should just happen in RichEdit when WS_VSCROLL | ES_DISABLENOSCROLL styles are applied together.
RICHEDIT vs EDIT SCROLLBARS
From the Scrollbar pov, RichEdit is behaving as its small bro Edit control. When creating an EDIT control in Windows, if you add a WS_HSCROLL or WS_VSCROLL, the scroll is always added even if the content fits the Client area. EDIT control scrollbars, let's say, are not intelligent. If you want to hide scrollbars in an EDIT control when the content fits the Client area, you are enforced to subclass the EDIT, hear for WM_SIZE and FONT messages, and react accordingly with ShowScrollBar()
Reference: https://stackoverflow.com/questions/18144388/how-to-auto-hide-scrollbars-on-edit-control (Remy Lebeau answer)
Bonus: Probably this explains the reason why in the Font Settings dialogs (where several controls lets you select the Font, its Size, its Weight, etc) micro-scrollbars totally unneeded are always painted (probably because these controls are RichEdit controls).
ccing jimtabor
Attachments
Issue Links
- relates to
-
CORE-15758 Uninstaller of MS .NET 4.0 draws an unintended vertical scrollbar that partly disappears upon mouse scrollwheel scrolling
- Open