home *** CD-ROM | disk | FTP | other *** search
/ Chip 1999 May / Chip_1999-05_cd.bin / ctenari / Lukas / Unit2.~pa < prev    next >
Text File  |  1999-02-24  |  2KB  |  79 lines

  1. unit Unit2;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   StdCtrls, Buttons, ExtCtrls;
  8.  
  9. type
  10.   TForm2 = class(TForm)
  11.     SpeedButton1: TSpeedButton;
  12.     Label1: TLabel;
  13.     Label2: TLabel;
  14.     ListBox1: TListBox;
  15.     ListBox2: TListBox;
  16.     Button1: TButton;
  17.     Panel1: TPanel;
  18.     procedure SpeedButton1Click(Sender: TObject);
  19.     procedure ListBox1Click(Sender: TObject);
  20.     procedure Button1Click(Sender: TObject);
  21.     procedure ListBox2Click(Sender: TObject);
  22.   private
  23.     { Private declarations }
  24.   public
  25.     { Public declarations }
  26.   end;
  27.  
  28. var
  29.   Form2: TForm2;
  30.  
  31. implementation
  32.  
  33. {$R *.DFM}
  34.  
  35. procedure TForm2.SpeedButton1Click(Sender: TObject);
  36. var
  37. i,j,k,h,h2:integer;
  38. s0,s1,s2,s3:string;
  39. begin
  40. ListBox2.Visible:= false;
  41. ListBox2.Visible:= false;
  42. Label1.Visible:= false;
  43. Label2.Visible:= false;
  44. for i := 0 to ListBox1.Items.Count - 1 do
  45. ListBox1.Visible:= false;
  46. s2:=InputBox('JmΘno','napiÜ jmΘno','jmΘno, kterΘ chceÜ najφt');
  47. h:=ListBox1.Items.Indexof(s2);
  48. h2:=ListBox2.Items.Indexof(' ');
  49. ListBox1.ItemIndex:= h;
  50. ListBox2.ItemIndex:= h;
  51. Label1.Visible:= true;
  52. Label2.Visible:= true;
  53. for j := 0 to ListBox2.Items.Count - 1 do
  54. s0:= ListBox1.Items [ListBox1.ItemIndex];
  55. Label1.Caption:= s0 + '  mß svßtek';
  56. Label2.Caption:=ListBox2.Items [ListBox2.ItemIndex];
  57. end;
  58. procedure TForm2.ListBox1Click(Sender: TObject);
  59. var
  60. h:integer;
  61. begin
  62. h:=ListBox1.ItemIndex;
  63. ListBox2.ItemIndex:=h;
  64. end;
  65.  
  66. procedure TForm2.Button1Click(Sender: TObject);
  67. begin
  68. close;
  69. end;
  70.  
  71. procedure TForm2.ListBox2Click(Sender: TObject);
  72. var
  73. h:integer;
  74. begin
  75. h:=ListBox2.ItemIndex;
  76. ListBox1.ItemIndex:=h;
  77. end;
  78. end.
  79.