I should have shown you how to create the events for
the combo & edit:

type
  TtwsEditCombo = class(TWinControl)
  private
    { Private declarations }
    FCombo: TComboBox;
    FEdit: TEdit;

    procedure DoComboLostFocus(Sender: TObject);
    procedure DoComboHasFocus(Sender: TObject);
    procedure DoEditLostFocus(Sender: TObject);
    procedure DoEditHasFocus(Sender: TObject);
  protected
    { Protected declarations }
  public
    { Public declarations }
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
  published
    { Published declarations }
    property Combo: TComboBox read FCombo Write
FCombo;
    property Edit: TEdit read FEdit Write FEdit;
    property OnDockDrop;
    property OnDockOver;
    property OnEnter;
    property OnExit;
    property OnGetSiteInfo;
    property OnKeyDown;
    property OnKeyPress;
    property OnKeyUp;
    property OnUnDock;
  end;

procedure Register;

implementation

constructor TtwsEditCombo.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
  { ToDo : Add your initialization code here. }
  { TCombo }
  FCombo:= TComboBox.Create(self);
  FCombo.Parent := self;
  with FCombo do begin
    { set default values }
    visible := false;
    Color := clYellow; 
    OnExit := DoComboLostFocus;
    OnEnter:= DoComboHasFocus;
  end;
  { TEdit }
  FEdit:= TEdit.Create(self);
  FEdit.Parent := self;
  with FEdit do begin
    { set default values }
    visible := true;
    OnExit := DoEditLostFocus;
    OnEnter:= DoEditHasFocus;
  end;

end;  { Create }

destructor TtwsEditCombo.Destroy;
begin
  FCombo.Free;
  FEdit.Free;
  inherited Destroy;
end;  { Destroy }

procedure TtwsEditCombo.DoComboLostFocus(Sender:
TObject);
begin
  FEdit.Visible := true;
  FCombo.Visible := false;
end;

procedure TtwsEditCombo.DoComboHasFocus(Sender:
TObject);
begin
  //
end;

procedure TtwsEditCombo.DoEditLostFocus(Sender:
TObject);
begin
  //
end;

procedure TtwsEditCombo.DoEditHasFocus(Sender:
TObject);
begin
  FEdit.Visible := false;
  FCombo.Visible := true;
end;


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/i7folB/TM
--------------------------------------------------------------------~-> 

-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to