Change the content of the public dialog

zhaozj2021-02-11  193

Changing the title of the Open button in the Open Dialog In fact, the BCB's open dialog is the standard dialog form that calls Windows, since we can do some changes through the WinApi function.

We added OnShow event in the following code void __fastcall TForm1 :: OpenDialog1Show (TObject * Sender) {HWND hwndDialog = GetParent (OpenDialog1-> Handle); HWND hwndButton = GetDlgItem (hwndDialog, 1); SetWindowText (hwndButton, "& accession" }

1. Note that getParent is actually the handle 2 of TopEndialog. Then use the getDlgitem () function to get the handle of the "Open" button in the dialog. Note TopEndialog is a resource ID in each component on the dialog form on the dialog. The "Open" resource ID is 1. Similarly, this method can change most of the content on the dialog form can be changed 3. Change the CAPTION of the "Open" button "& Join File"

转载请注明原文地址:https://www.9cbs.com/read-4928.html

New Post(0)