unit UMComboBoxMce;
	
interface

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

type

MComboBoxMce = class(TComboBox)
private
	procedure   Wypelnij_i_ustaw_cb();

public
	constructor Create(AOwner: TComponent; parParent : TWinControl);
end;

implementation
{------------------------------------------------------------------------------}
constructor MComboBoxMce.Create(AOwner: TComponent; parParent: TWinControl);
begin
	inherited Create(AOwner);
	Parent := parParent;
	Wypelnij_i_ustaw_cb();
end;

procedure MComboBoxMce.Wypelnij_i_ustaw_cb();
var
   Year, Month, Day : Word;

   mc         : Integer;
   dzisiaj    : TDate;
   poz        : Integer;
   seekmc     : Integer;
   txt        : String;

begin
   mc      := 0;
   dzisiaj := Date();
   poz     := 0;
   seekmc  := 0;
   txt     := '';

   Clear();
   Width := 45;

   for mc := 1 to 12 do
   begin
      Items.Add(IntToStr(mc));
   end;

   dzisiaj := Date();
   DecodeDate(dzisiaj, Year, Month, Day);
   seekmc  := Month;
   txt     := IntToStr(seekmc);

	ItemIndex := -1;
   poz := Items.IndexOf(txt);
   if poz > -1 then
   begin
      ItemIndex := poz;
   end;
end;

end.

