Forum > RichMemo

Colunns with richmemo?

<< < (2/4) > >>

vladimirr:

--- Quote ---I don't understand how to make a tab

--- End quote ---

You have to use '\tab ' inside your rich string.

example := 'some text \tab moretext';

Fabius:
Hello
I have trouble understanding, sorry

my end of the program
I list the records of the table

I would like each field of the row to be in columns

How to do ?

thank you in advance


 while not lignesDeSaisie.EOF do
          begin
           NnnnLignes := NnnnLignes+1;

           Lllll := '| ' + lignesDeSaisie.FieldByName('compte').AsString + ' \tab ' + lignesDeSaisie.FieldByName('label').AsString + ' \tab ' + FloatToStr(lignesDeSaisie.FieldByName('credit').AsFloat) + ' #9  | ' + FloatToStr(lignesDeSaisie.FieldByName('debit').AsFloat) + ' |';

            ////RichMemo1.Lines.Add('|----------------------------------------------------------------------');

            RichMemo1.Lines.Add(Lllll);




            lignesDeSaisie.Next;
          end;                       

skalogryz:
here's the code sample:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TForm1.Button1Click(Sender: TObject);var  st : TTabStopList;  i  : integer;begin   RichMemo1.GetParaTabs(0, st); // getting the current tabs   st.Count:=8;  SetLength(st.Tabs, st.Count);  for i:=0 to length(st.Tabs)-1 do    st.Tabs[i].Offset:=i*72;  RichMemo1.SetParaTabs(-1,-1,st); // assigning tabs stops   // assigning text with tabs (#9)  RichMemo1.Lines.Add('hello'#9'world'#9'to'#9'columns');  RichMemo1.Lines.Add('does'#9'it'#9'look'#9'good'#9'?');  RichMemo1.Lines.Add('tab'+#9+'is'+#9+'character'+#9+'9');end;
upd I've added this sample to the wiki page

Fabius:
Hello
big thank you for this constructive response :)

Do you know how to adjust the width of each column and what is fixed, is it possible?

I have table fields and the content is variable

Fabius:
My code

begin
(*
*)
RichMemo1.GetParaTabs(0, st); // getting the current tabs
st.Count:=8;
SetLength(st.Tabs, st.Count);
for i:=0 to length(st.Tabs)-1 do
  st.Tabs.Offset:=i*172;  ///plus large
RichMemo1.SetParaTabs(-1,-1,st); // assigning tabs stops

// assigning text with tabs (#9)
RichMemo1.Lines.Add('Compte'#9'Label..................................'#9'Credit'#9'Debit');
  while not lignesDeSaisie.EOF do
  begin
   NnnnLignes := NnnnLignes+1;

   Lllll := lignesDeSaisie.FieldByName('compte').AsString + #9 + lignesDeSaisie.FieldByName('label').AsString + #9 + FloatToStr(lignesDeSaisie.FieldByName('credit').AsFloat) + #9 + FloatToStr(lignesDeSaisie.FieldByName('debit').AsFloat) ;

    ////RichMemo1.Lines.Add('|----------------------------------------------------------------------');

    RichMemo1.Lines.Add(Lllll);



    lignesDeSaisie.Next;
  end;
end;

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version