Many thanks for the hints, I'll give it a try today.

Paul.


Experience is something you don't get until just after you need it. 

----- Original Message -----
From: "logman0u812" <[EMAIL PROTECTED]>
To: [email protected]
Subject: Re: [delphi-en] Creating Controls
Date: Mon, 12 Sep 2005 09:06:22 -0700 (PDT)

> 
> 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
> 
> 
> 
> -----------------------------------------------------
> Home page: http://groups.yahoo.com/group/delphi-en/
> To unsubscribe: [EMAIL PROTECTED]
> Yahoo! Groups Links
> 
> 
> 
> 




-- 
_______________________________________________
Surf the Web in a faster, safer and easier way:
Download Opera 8 at http://www.opera.com

Powered by Outblaze


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Most low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/cd_AJB/QnQLAA/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