unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls;

type
  TForm1 = class(TForm)
    ListBox1: TListBox;
    Label1: TLabel;
    Shape1: TShape;
    procedure ListBox1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.ListBox1Click(Sender: TObject);
begin
    with ListBox1 do
  case ItemIndex of
  0: Shape1.Brush.Color:=clWhite;
  1: Shape1.Brush.Color:=clRed;
  2: Shape1.Brush.Color:=clBlue;
  3: Shape1.Brush.Color:=clOlive;
  4: Shape1.Brush.Color:=clGray;
  5: Shape1.Brush.Color:=clGreen;
  6: Shape1.Brush.Color:=clYellow;
  end;
  Label1.Caption:=Listbox1.Items.Strings[Listbox1.Itemindex];
end;

end.
