Chart Title on 2 lines [SOLVED] lazarus / 55-TAChart ---------------------------------------------------------------------- AL · 2019-11-26 15:57 When I try to modify the chart title with an inputbox,  I always get a title on 2 lines when I only add some text in the input box. If I erase the last character and then type more characters then the title is on one line as it should. It seems like a line feed is in the original title and InputBox keeps it. Any Hint?  NewTitle:= (Inputbox (RsNewTitle ,RsEnterNewTitl , SpectrumChart.Title .Text .Text));  SpectrumChart.Title.Text.Text := NewTitle ;                        Thanks ---------------------------------------------------------------------- wp · 2019-11-26 16:36 TChart.Title.Text is a TStrings class. And every TStrings instance, when its items are stuffed into a single string, has a line feed at its end: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i program Project1; uses  Classes; var  L: TStrings;begin  L := TStringList.Create;  L.Add('ABC');  WriteLn('---------');  WriteLn(L.Text);  WriteLn('---------');  WriteLn(L[0]);  WriteLn('---------');   ReadLn;end.   See the empty line after the first 'ABC'? This is the same line break that you are talking abount. As a workaround you could simply use the first element of the TStrings: Chart.Title.Text.Text[0] (but don't forget to check against an empty list: "if Chart.Title.Text.Count > 0 then..."). Or you could filter the ending linebreak from the input string before passing it to the input box: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function CleanString(AString: String): String;begin  Result := AString;  while (Result <> '') and (Result[Length(Result)] in [#13, #10]) do    Delete(Result, Length(Result), 1);end; procedure TForm1.Button1Click(Sender: TObject);var  NewTitle: String;begin   NewTitle := Inputbox ('New Title', 'Text', CleanString(Chart1.Title.Text.Text));   Chart1.Title.Text.Text := NewTitle;end;     Or you could design a dedicated input form with a memo because TAChart does support multi-line titles, and there is no other way to input a multiline title at GUI level without a memo. ---------------------------------------------------------------------- lucamar · 2019-11-26 17:27 Alternatively, you can set the TStrings property SkipLastLineBreak to True to prevent that final line break. ---------------------------------------------------------------------- AL · 2019-11-26 19:00 Quote from: lucamar on November 26, 2019, 06:27:01 pmAlternatively, you can set the TStrings property SkipLastLineBreak to True to prevent that final line break. That did it.  Thank you very much       SpectrumChart.Title .Text.SkipLastLineBreak:= true;       NewTitle:= (Inputbox (RsNewTitle ,RsEnterNewTitl , SpectrumChart.Title .Text.Text));       SpectrumChart.Title.Text.Text := NewTitle ;