eGospodarka.pl
eGospodarka.pl poleca

eGospodarka.plGrupypl.misc.elektronika[trochę NTG] freepascal, lazarus i formatowanie stringaRe: [trochę NTG] freepascal, lazarus i formatowanie stringa
  • Path: news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.
    atman.pl!.POSTED!not-for-mail
    From: John Smith <d...@b...pl>
    Newsgroups: pl.misc.elektronika
    Subject: Re: [trochę NTG] freepascal, lazarus i formatowanie stringa
    Date: Fri, 15 Nov 2013 20:46:52 +0100
    Organization: ATMAN - ATM S.A.
    Lines: 63
    Message-ID: <l65tni$ipa$1@node1.news.atman.pl>
    References: <l60ugq$r79$1@node2.news.atman.pl> <l62tab$6j4$1@dont-email.me>
    <l62v9d$q4t$1@node2.news.atman.pl> <l633dm$jvn$1@node1.news.atman.pl>
    <l6376q$2nf$1@node2.news.atman.pl> <l63saf$e63$1@node1.news.atman.pl>
    <l65q44$ett$1@node1.news.atman.pl>
    Reply-To: d...@b...pl
    NNTP-Posting-Host: 118.188.rev.vline.pl
    Mime-Version: 1.0
    Content-Type: text/plain; charset=UTF-8; format=flowed
    Content-Transfer-Encoding: 8bit
    X-Trace: node1.news.atman.pl 1384544818 19242 217.76.118.188 (15 Nov 2013 19:46:58
    GMT)
    X-Complaints-To: u...@a...pl
    NNTP-Posting-Date: Fri, 15 Nov 2013 19:46:58 +0000 (UTC)
    User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130307 Thunderbird/17.0.4
    In-Reply-To: <l65q44$ett$1@node1.news.atman.pl>
    Xref: news-archive.icm.edu.pl pl.misc.elektronika:655247
    [ ukryj nagłówki ]


    > Kolumny stworzone we właściwościach StringGrida, tak żeby miały już
    > konkretne nazwy, szerokości etc. Zresztą jak wrzuce do kolumny numer 1
    > jakąś wartość numeryczną to ją widzę.

    Prosiłem o krótki program, ten co przysłałeś pozwoliłem sobie uprościć
    do problemu StringGrid:

    unit Unit1;

    interface

    uses
    Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
    System.Classes, Vcl.Graphics,
    Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.Grids, Vcl.StdCtrls,
    Vcl.Samples.Spin;

    type
    TForm1 = class(TForm)
    Button1: TButton;
    StringGrid1: TStringGrid;
    SpinEdit1: TSpinEdit;
    procedure Button1Click(Sender: TObject);
    private
    { Private declarations }
    public
    { Public declarations }
    end;

    var
    Form1: TForm1;

    implementation

    {$R *.dfm}

    procedure TForm1.Button1Click(Sender: TObject);
    var
    i: integer;
    ilosc_osobnikow : integer;
    begin
    ilosc_osobnikow := SpinEdit1.Value;
    //StringGrid1.Clear;
    StringGrid1.RowCount:=ilosc_osobnikow+1;
    // for i:=1 to ilosc_osobnikow do
    // begin
    // osobniki[i].numer:=i;
    // osobniki[i].genotyp:=permutacja(8);
    // end;
    for i:=1 to ilosc_osobnikow do
    begin
    StringGrid1.Cells[0,i]:= 'abc'; //Format('%d', [osobniki[i].numer]);
    StringGrid1.Cells[1,i]:= 'def'; //Format('%s', [osobniki[i].genotyp]);
    end;
    end;

    end.


    Ta wersja działa zgodnie z oczekiwaniem pod Delphi.
    K.

Podziel się

Poleć ten post znajomemu poleć

Wydrukuj ten post drukuj


Następne wpisy z tego wątku

Najnowsze wątki z tej grupy


Najnowsze wątki

Szukaj w grupach

Eksperci egospodarka.pl

1 1 1

Wpisz nazwę miasta, dla którego chcesz znaleźć jednostkę ZUS.

Wzory dokumentów

Bezpłatne wzory dokumentów i formularzy.
Wyszukaj i pobierz za darmo: