title: How to center a text of an edit box in Delphi7?
body: <p>I am currently working on a BlackJack application in Delphi7 and I am trying to center the text of an edit box in order to later show the card value. I found this documentation (<a href="http://delphidabbler.com/tips/85" rel="nofollow noreferrer">http://delphidabbler.com/tips/85</a>) and now I am failing to properly implement it. I put the code from the link into "Unit2" and am now trying to call both functions on my edit boxes from "Unit1" to align their text. Whenever i try to call one of both functions it tells me that passed parameters aren't identical.
  If you guys would be able to help me out, it would be much appreciated.</p>
  
  <p>Here is the decleration of Unit1:</p>
  
  <pre><code> unit Unit1;
  
  interface
  
  uses
    Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
    Dialogs, StdCtrls,Unit2;
  
  type
    TForm1 = class(TForm)
      Edit1: TEdit;
      Button10: TButton;
      Button4: TButton;
      Edit2: TEdit;
      Edit3: TEdit;
  
  [...]
  </code></pre>
  
  <p>Here the code of Unit2:</p>
  
  <pre><code>unit Unit2;
  
  interface
  
  uses
    Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
    Dialogs, StdCtrls;
  
  type
    TMyEdit = Class(TEdit)
    public
      FAlignment: TAlignment;
      procedure SetAlignment(Value: TAlignment);
      procedure CreateParams(var Params: TCreateParams); override;
      property Alignment: TAlignment read FAlignment write SetAlignment;
    end;
  
  implementation
  
  procedure TMyEdit.CreateParams(var Params: TCreateParams);
  begin
    inherited CreateParams(Params);
    case Alignment of
      taLeftJustify:
        Params.Style := Params.Style or ES_LEFT and not ES_MULTILINE;
      taRightJustify:
        Params.Style := Params.Style or ES_RIGHT and not ES_MULTILINE;
      taCenter:
        Params.Style := Params.Style or ES_CENTER and not ES_MULTILINE;
    end;
  end;
  
  procedure TMyEdit.SetAlignment(Value: TAlignment);
  begin
    if FAlignment &lt;&gt; Value then
    begin
      FAlignment := Value;
      RecreateWnd;
    end;
  end;
  end.
  </code></pre>