The VCL control on the Dialogs page on the C++builder Control Panel includes Windows common dialog boxes. In other words, VCL does not provide dialog boxes, which are part of Windows. VCL just makes it easier to use these dialog boxes. In some applications, you may want to change the title of the Open button in the Open dialog box, for example, to indicate that your program allows the user to add files to the document, in which case you might want to open the title on the button instead of "open". You can simply change the title of any button on a generic dialog, and the OnShow event that opens the dialog box can be used to do this.
The following code shows how to change:
void __fastcall TForm1::OpenDialog1Show(TObject *Sender)
{
HWND
hwndDialog = GetParent(OpenDialog1->Handle);
HWND hwndButton =GetDlgItem(hwndDialog, 1);
SetWindowText(hwndButton, "&Add Files");
}
The first line is to get the handle to open the dialog box, note: Call GetParent () and pass the handle of the topendialog.
The next line uses the GetDlgItem () function to get the handle to the Open button in the dialog box.
Note: The passed handle is the handle of the first row of the dialog box and the dialog resource identified as one.
Remember, opening a dialog box is not a VCL Form, but a real Windows dialog box. Each control on the dialog box has a resource ID. The resource ID for the Open button is 1.