طباعة في MEMO في سطر واحد
#1
هذا كود سورس أريد طباعة في MEMO كالتالي في سطر واحد        P1P1P1P2P2
[صورة: 14615050192241.png]
كود :
procedure TForm1.Button14Click(Sender: TObject); //edit4.Text:=CXmemo2.Lines[1][8]; var i,j,k,l:integer;  m:string; begin i:=1; j:=1; k:=1; //StringGrid1.ColCount:=strtoint(edit1.Text); //StringGrid1.RowCount:=strtoint(edit2.Text); with StringGrid1  do  WHILE I <=strtoint(edit1.Text) do  BEGIN  WHILE J <= strtoint(edit2.Text) do      begin       if strtoint(Cells[i,j])>0 then        begin         l:=StrToInt(Cells[i,j]) ;         m:= (Cells[i-1,j]);        cxmemo4.Lines.ADD(Cells[i-1,j]);         //cxMemo4.Lines.Strings[k]:=(DupeString(m, l));         //k:=K+l;         ListBox1.Items.Add(Cells[i-1,j])        end;       J:=j+1;      end;       i:=i+1;   end; end;
الرد
#2
السلام عليكم
لنفترض أنه لدينا Stringgrid, بالمواصفات التالية:
ColCount=2
FixedCols=0
FixedRows=0
RowCount=3
ولدينا في تسجيلاته على الترتيب:
P1, 3
P2, 2
P3, 1
يكون كود الزر على الشكل التالي:
كود :
procedure TForm1.Button1Click(Sender: TObject); var  I: Integer;  j: Integer; begin  Memo1.Clear;  for I := 0 to StringGrid1.RowCount - 1 do  begin    for j := 0 to strtoint(StringGrid1.Cells[1, I]) - 1 do      Memo1.Lines[0] := Memo1.Lines[0] + StringGrid1.Cells[0, I];  end; end;
الرد


التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم