How can I hide controls in an OpenDialog?
Applies To: C++Builder 1 or higher
Category: Knowledge Base

-
- Start a new application.
-
- Add an OpenDialog. Edit its OnShow event:
-
- void __fastcall TForm1::OpenDialog1Show(TObject *Sender)
- {
- #define IDFILENAME 1090
- #define IDFILENAMELABEL 1152
-
- SendMessage(GetParent(dynamic_cast<TOpenDialog*>
- (Sender)->Handle), CDM_HIDECONTROL, IDFILENAME, 0);
-
- SendMessage(GetParent(dynamic_cast<TOpenDialog*>
- (Sender)->Handle), CDM_HIDECONTROL,
- IDFILENAMELABEL, 0);
- }
-
- Add a Button. Edit its OnClick event:
-
- void __fastcall TForm1::Button1Click(TObject *Sender)
- {
- OpenDialog1->Execute();
- }
-
- When you show the OpenDialog, the file name edit box and file name label will be missing.
C++Builder Developer's Network
Copyright © Yoto Yotov