You could have overriden the OnPaint for the combox and add some code to paint it as a TEdit when not in focus, then default drawing when in focus.
  
  Dave

Paul Bennett <[EMAIL PROTECTED]> wrote:
  My current project requires me to create a custom control to provide a required 'look and feel' to the data entry forms.

This look and feel involves having a control that appears to be a standard TEdit when it has not got the focus, but on receiving focus changes to a standard ComboBox!

I have not done any custom control programming before. I have started with deriving from TCustomEdit and adding a private TComboBox field.
I have then tried to expose the Items property (using Getter/Setter routines) I get an error message telling me that the control has no parent window. I have tried assigning the parent in the constructor, but no good.
Below is the Constructor code plus the Getter/Setters:

constructor TtwsEditCombo.Create(Owner: TComponent);
begin
  inherited Create (Owner);
  fCombo := TComboBox.Create(Self);
  fCombo.ParentWindow := Self.ParentWindow;
end;

function TtwsEditCombo.GetItemIndex: Integer;
begin
  Result := fCombo.ItemIndex;
end;

function TtwsEditCombo.GetItems: TStrings;
begin
  Result := fCombo.Items;
end;

procedure TtwsEditCombo.SetItemIndex(const Value: integer);
begin
  fCombo.ItemIndex := Value;
end;

procedure TtwsEditCombo.SetItems(const Value: TStrings);
begin
  fCombo.Items := Value;
end;

Any pointers would be most gratefully received.

Paul.

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


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

Powered by Outblaze


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


   
---------------------------------
  YAHOO! GROUPS LINKS

   
    Visit your group "delphi-en" on the web.
   
    To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
   
    Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

   
---------------------------------
 



           
---------------------------------
Yahoo! Messenger with Voice. PC-to-Phone calls for ridiculously low rates.

[Non-text portions of this message have been removed]



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




YAHOO! GROUPS LINKS




Reply via email to