Save Dialog

Does anyone know how to change the text on the buttons in the SaveDialog under Delphi 2?
Who is Participating?

Improve company productivity with a Business Account.Sign Up

Mohammed NasmanConnect With a Mentor Software DeveloperCommented:
Helli Winuser2000

  I went to computer have delphi2 and test the code, i'm sorry to tell you that not working with delphi 2 :(

 Open/save dialog, don't have the onshow event

also there's no handle for open/save dialog :((

  I tested my code with delphi5/6 and it's working fine, but with delphi two it will not work

You may be able to locate the properties for this dialog in Dialog.pas

Locate ButtonNames....

You should save this file to a different name before you go making any changes to it or else you'll be reinstalling Delphi!

You'll also have to import the "new" savedialog as a new component!

winuser2000Author Commented:
gemarti:  I had a look in the Dialog.pas but no button names labelled "save".  All that was there was:

ButtonNames: array[TMsgDlgBtn] of string = ('Yes', 'No', 'OK', 'Cancel', 'Abort', 'Retry', 'Ignore', 'All', 'Help');

and i checked throught the rest of the code but no luck
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Mohammed NasmanSoftware DeveloperCommented:

   you can do that with SetDlgItemText API, in the onShowEvent for the SaveDialog place two these lines

  SetDlgItemText(GetParent(OpenDialog1.Handle), IDOK, PChar('New &Open'));
  SetDlgItemText(GetParent(OpenDialog1.Handle), IDCANCEL, PChar('New &Cancel'));

Best regards
Mohammed Nasman
winuser2000Author Commented:
Thanks mnasman but there is no onshowevent for the savedialog in delphi 2as far as i can see.
Mohammed NasmanSoftware DeveloperCommented:
Sorry winuser2000

 I mean the event Onshow not OnshowEvnet
procedure TForm1.OpenDialog1Show(Sender: TObject);
winuser2000Author Commented:
thanks mnasman but i cannot compile as it keeps saying about "handle" being an undeclared identifier - i have looked in the help files to see if it would give any answer but as usual the help file is not very useful.

any ideas?
winuser2000Author Commented:
Sheesh, story of my life finding out that it won't work.  Thanks for checking it out for me and for the help you gave.  I shall give you the points because you helped the most.
Mohammed NasmanSoftware DeveloperCommented:
thanks alot winuser2000, I don't deserve the points cuz i didn't solve ur problem

  there's also another way, using sendmessage and WM_SetText, but also require the handle, and that's not exist with opendialog in delphi2 :(

 try to check in site, maybe there's some free components can do that for you

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.