title: Custom MessageDlg
body: <p>I'm trying to make a custom messagedlg in borland c++ builder. But the code bellow instead to change button captions, creates new buttons on left upper corner of dialog form.</p>
  
  <pre><code>#include &lt;vcl.h&gt;
  #pragma hdrstop
  
  #include "frmMsgDlg.h"
  //---------------------------------------------------------------------------
  #pragma package(smart_init)
  #pragma resource "*.dfm"
  TForm1 *Form1;
  //---------------------------------------------------------------------------
  __fastcall TForm1::TForm1(TComponent* Owner)
      : TForm(Owner)
  {
  }
  int __fastcall MsgDlg( const String Msg, TMsgDlgType DlgType, TMsgDlgButtons Buttons, const String* Captions, int Captions_maxidx )
  {
    int m = 0;
    TButton *DlgButton;
    int CaptionIndex = 0;
    TForm* aMsgDlg = CreateMessageDialog( Msg, DlgType, Buttons );
    aMsgDlg-&gt;Color = TColor(clWindow);
  
    for ( m = 0; m &lt;= aMsgDlg-&gt;ComponentCount - 1; m++)
    {
      if ( dynamic_cast&lt; TButton *&gt;( aMsgDlg-&gt;Components[m] ) )
      {
        DlgButton = new TButton( aMsgDlg-&gt;Components[m] );
        DlgButton-&gt;Parent = aMsgDlg;
        if ( CaptionIndex &gt; Captions_maxidx /*# High(Captions) */ ) break;
  
        DlgButton-&gt;WordWrap = true;
        DlgButton-&gt;Caption = Captions[CaptionIndex];
        DlgButton-&gt;Width = 56;
        DlgButton-&gt;Height= 28;
        DlgButton-&gt;Cancel = false;
        CaptionIndex++;
      }
    }
    return aMsgDlg-&gt;ShowModal();
  
  }
  //---------------------------------------------------------------------------
  void __fastcall TForm1::FormShow(TObject *Sender)
  {
    int msg;
    String capt[2] = {"PO","JO"};
  
    msg = MsgDlg("Tre tentime dështuan, ju lutem startoni programin nga ikona!!!", mtInformation,TMsgDlgButtons() &lt;&lt; mbOK &lt;&lt;mbCancel,capt,2);
  
  }
  //---------------------------------------------------------------------------
  </code></pre>