tmemo

Delphi XE4 FireMonkey TMemo Transparent? (iOS)

允我心安 提交于 2019-12-05 06:17:41
Is there any way to make the TMemo transparent in Delphi/iOS/FireMonkey? I don't see any way to edit styles myself when selecting + right-clicking the memo control... Try removing memo's background on applying style event. procedure TForm1.Memo1ApplyStyleLookup(Sender: TObject); var BckObject: TFmxObject; begin BckObject := Memo1.FindStyleResource('background'); if Assigned(BckObject) and (BckObject is TSubImage) then begin TSubImage(BckObject).Source := nil; end; end; You need to change the style of the control you want to display transparent as you want. Unfortunately Embarcadero does not

TMemo max width

我与影子孤独终老i 提交于 2019-12-04 04:19:45
问题 Is there any way to make TMemo display text longer than 1024 into 1 line? Take a look this simple code: procedure TForm1.Button2Click(Sender: TObject); var s: string; i: integer; begin s := ''; for i := 0 to 10000 do s := s + 'a'; Memo1.Clear; Memo1.Lines.Add(s); end; The long text "s" will be displayed in multiple lines. The Memo1 will automatically wrap the text after 1024 characters. 回答1: A TMemo is a wrapper for a native multi line edit control and is subject to the limitations it has.

TMemo cannot handle Unix text (LF as line ending) correctly

偶尔善良 提交于 2019-12-01 13:23:18
TMemo cannot handle Unix enters (LF) correctly. Two lines separated with a LF are shown and treated as one line. I want to handle all possible text formating (Mac, Win, Unix). Obviously I could check the text and replace the LF with CRLF every time I: load text form file paste text use the Add() function use the Insert() function use the Appen() function change the content via Text property But this won't be an elegant solution. Lazarus solved this problem with the Lines.TextLineBreakStyle property. There is anything similar in Delphi XE? You're asking specifically about line-ending sequences,

Can I make a TMemo size itself to the text it contains?

狂风中的少年 提交于 2019-11-28 13:24:17
When you edit a TLabel's caption in the form designer, it resizes the TLabel for you. Is there any way I can get a TMemo to do that, at runtime? I'd like to be able to take a TMemo, assign something to its .lines.text property, and then tell it to resize itself and not exceed a certain width, though it can get as tall as it wants to. Anyone know how to do that? A. I. Breveleri Set the WordWrap property of the TMemo to true, dump your text into it, count the lines, and set the height to the product of the line count and the line height, but you need to know the line height. The TMemo does not

How do I determine the height of a line of text in a TMemo programmatically?

旧时模样 提交于 2019-11-28 10:31:53
问题 I've got a TMemo, and I want to always make it exactly high enough to display the number of lines it contains. Unfortunately, I don't quite know how to calculate that. I can't base it off the .Font.Size property, because that will vary based on DPI. And I can't use TCanvas.TextHeight because TMemo doesn't seem to have a canvas. Anyone know how to do this right? 回答1: You need to use a TCanvas for this. You can either create a TBitMap in the background and use its TCanvas (after assigning the

Can I make a TMemo size itself to the text it contains?

柔情痞子 提交于 2019-11-27 07:38:02
问题 When you edit a TLabel's caption in the form designer, it resizes the TLabel for you. Is there any way I can get a TMemo to do that, at runtime? I'd like to be able to take a TMemo, assign something to its .lines.text property, and then tell it to resize itself and not exceed a certain width, though it can get as tall as it wants to. Anyone know how to do that? 回答1: Set the WordWrap property of the TMemo to true, dump your text into it, count the lines, and set the height to the product of