unit Main;

interface

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

type
  TMainForm = class(TForm)
    Panel1: TPanel;
    BitBtn1: TBitBtn;
    cb1: TComboBox;
    Label1: TLabel;
    Label2: TLabel;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormShow(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);

  private
    cb : MComboBoxTN;

  public
	 procedure Wypelnij_i_ustaw_mc();
  end;

var
  MainForm: TMainForm;

implementation
{$R *.dfm}
{------------------------------------------------------------------------------}
procedure TMainForm.BitBtn1Click(Sender: TObject);
begin
	Close();
end;

procedure TMainForm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
	FreeAndNil(cb);
end;

procedure TMainForm.Wypelnij_i_ustaw_mc();
begin
   cb1.Clear();

   cb1.Items.Add('Tak');
   cb1.Items.Add('Nie');

	cb1.Width := 50;
	cb1.ItemIndex := 0;
end;

procedure TMainForm.FormShow(Sender: TObject);
begin
	Wypelnij_i_ustaw_mc();

	cb        := MComboBoxTN.Create(Self);
   cb.Parent := Self;
   cb.Left   := cb1.Left;
   cb.Top    := cb1.Top + cb1.Height + 10;
end;

end.

