We all know that many controls in Delphi have scroll bars, but floating scroll bars are very popular now. Delphi's controls do not have this appearance. The FloatStyle suite is now popular. But what should I do if I don’t have this set of controls and want to have a floating scroll bar?
Use the InitializeFlatSB function in the commctrl unit
Let’s look at an example below. It’s very interesting.
unit Unit1;
interface
uses
Windows, Messages, commctrl, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Memo1: TMemo;
PRocedure Button1Click(Sender: TObject);
private
{Private declarations}
public
{Public declarations}
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
InitializeFlatSB(Memo1.Handle);
end;
end.
If you want to cancel, just call UninitializeFlatSB.