home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1999 May
/
Chip_1999-05_cd.bin
/
ctenari
/
Lukas
/
Unit2.pas
< prev
Wrap
Pascal/Delphi Source File
|
1999-03-02
|
2KB
|
79 lines
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Buttons, ExtCtrls;
type
TForm2 = class(TForm)
SpeedButton1: TSpeedButton;
Label1: TLabel;
Label2: TLabel;
ListBox1: TListBox;
ListBox2: TListBox;
Button1: TButton;
Panel1: TPanel;
procedure SpeedButton1Click(Sender: TObject);
procedure ListBox1Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure ListBox2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.DFM}
procedure TForm2.SpeedButton1Click(Sender: TObject);
var
i,j,k,h,h2:integer;
s0,s1,s2,s3:string;
begin
ListBox2.Visible:= false;
ListBox1.Visible:= false;
Label1.Visible:= false;
Label2.Visible:= false;
for i := 0 to ListBox1.Items.Count - 1 do
ListBox1.Visible:= false;
s2:=InputBox('JmΘno','napiÜ jmΘno','jmΘno, kterΘ chceÜ najφt');
h:=ListBox1.Items.Indexof(s2); {pozice v ListBoxu1}
h2:=ListBox2.Items.Indexof(' ');{pozice v ListBoxu2}
ListBox1.ItemIndex:= h;{oznaΦenß pozice v ListBoxu1}
ListBox2.ItemIndex:= h; {oznaΦenß pozice v ListBoxu1}
Label1.Visible:= true;
Label2.Visible:= true;
for j := 0 to ListBox2.Items.Count - 1 do
s0:= ListBox1.Items [ListBox1.ItemIndex];
Label1.Caption:= s0 + ' mß svßtek';
Label2.Caption:=ListBox2.Items [ListBox2.ItemIndex];
end;
procedure TForm2.ListBox1Click(Sender: TObject);
var
h:integer;
begin
h:=ListBox1.ItemIndex;
ListBox2.ItemIndex:=h;
end;
procedure TForm2.Button1Click(Sender: TObject);
begin
close;
end;
procedure TForm2.ListBox2Click(Sender: TObject);
var
h:integer;
begin
h:=ListBox2.ItemIndex;
ListBox1.ItemIndex:=h;
end;
end.