Mirror

How to give the scrollbars of a TRichEdit a flat look (Views: 101)


Problem/Question/Abstract:

Does anyone know of a way to change the scroll bars in the RichEdit to obtain the flat look?

Answer:

Start with this one and do not forget to put CommCtrl in your uses clause:

procedure TForm1.FormCreate(Sender: TObject);
var
  XVerScrollInfo, XHorScrollInfo: TScrollInfo;
begin
  InitializeFlatSB(RichEdit1.Handle);
  GetScrollInfo(RichEdit1.Handle, SB_VERT, XVerScrollInfo);
  GetScrollInfo(RichEdit1.Handle, SB_HORZ, XHorScrollInfo);
  FlatSB_SetScrollProp(RichEdit1.Handle, WSB_PROP_VSTYLE, FSB_ENCARTA_MODE, True);
  FlatSB_SetScrollProp(RichEdit1.Handle, WSB_PROP_HSTYLE, FSB_ENCARTA_MODE, True);
end;

<< Back to main page