title: How to create and instantiate a user-defined component in Delphi?
body: <p>I want to create a search box for my application. The search box will include two things: a search filed and a search button. I think, the right thing to do would be to put those two components in a group box which will serve as a container to hold them inside. I figured that I needed to create a class derived from the TGroupBox class which upon creation will receive a table name as a parameter to search in. The two components, the search box and the button, are going to be its children - and those are the basic principles how it will be working.</p>
  
  <p>This picture illustrates what the search box will look like:</p>
  
  <p><img src="https://i.stack.imgur.com/aEstZ.png" alt="enter image description here"></p>
  
  <p>Here's what I've done so far:</p>
  
  <pre><code>unit clsTSearchBox;
  
  interface
  
      uses Classes, SysUtils, StdCtrls, Dialogs, ADODB, DataModule;
  
      type
          TSearchBox = class (TGroupBox)
              constructor CreateNew(AOwner: TObject; Dummy: Integer);     
          end;
  
  implementation
  
      constructor TSearchBox.CreateNew(AOwner: TObject; Dummy: Integer);
      begin
          inherited;
          Self.Height  := 200;
          Self.Width   := 400;
          Self.Caption := 'Test:'
      end;
  
  end.
  </code></pre>
  
  <p>As you can see, not much. I just created a class that I derived from the TGroupBox class. Please, help me write proper code to instantiate that search box component on my form because I don't really know how to do that. I only need code for proper object creation.</p>
  
  <p>Thank you all in advance.</p>