The Vcl Style Engine does not support correctly the scrollbar , in memo , the scrollbar is created from TScrollWindow class that is inherited from TWinControl class . the standard scrollbar (without vcl style) is painted as a part of memo .
When using the vcl style the scrollbar of memo become a top window , and that's what cause the previous problems.
if you look at the TScrollingStyleHook.UpdateScroll
event , you can find that the style engine use SetWindowPos
that bring the scrollbar to the top of others controls in order to show the scrollbar .
SetWindowPos(FVertScrollWnd.Handle, HWND_TOP, Control.Left + Left,
Control.Top + Top, Right - Left, Bottom - Top, SWP_SHOWWINDOW);
if you want to fix this issue you need to paint the scrollbar inside the TMemo class , in the WM_NCPAINT
message .