t j
t j

Reputation: 413

Why Is Firemonkey TMemo Borderless

Is there a way to provide a border for the memo box? I am currently putting the memo in a rectangle to give it a border and setting each of the memo margins to 1. I hate that I have to use this workaround. Using XE6 and XE7.

Upvotes: 0

Views: 653

Answers (2)

Илья Ильич
Илья Ильич

Reputation: 1

procedure TVariableHeight.Memo1Paint(Sender: TObject; Canvas: TCanvas;
  const ARect: TRectF);
begin
  if Canvas.BeginScene then
  begin
    with Canvas do
    begin
      Fill.Color := TAlphaColorRec.White;
      FillRect(RectF(0, 0, Memo1.Width, 1), 0, 0, AllCorners, 1);
      FillRect(RectF(0, 0, 1, Memo1.Height), 0, 0, AllCorners, 1);
      FillRect(RectF(Memo1.Width, 0, Memo1.Width - 1, Memo1.Height), 0, 0,
        AllCorners, 1);
      FillRect(RectF(0, Memo1.Height, Memo1.Width, Memo1.Height - 1), 0, 0,
        AllCorners, 1);
    end;
    Canvas.EndScene;
  end;
end;

Upvotes: 0

Yaroslav Brovin
Yaroslav Brovin

Reputation: 964

Only updating style for TMemo or use your workaround with TRectangle

Thanks

Upvotes: 1

Related Questions