How to detect Cancel button click n TRzSelectFolderDialog

Have a Raize Components question that does not fit into any of the forums below? Post it here.

How to detect Cancel button click n TRzSelectFolderDialog

Postby dkjMusic » Mon Mar 20, 2017 9:59 am

Is there a way to do this?

Thanks.
dkjMusic
 
Posts: 4
Joined:
Tue Mar 07, 2017 2:55 pm

Re: How to detect Cancel button click n TRzSelectFolderDialo

Postby Raize Support » Mon Mar 20, 2017 4:48 pm

Hi,

This post should really go in the Shell forum.

Anyway, the TRzSelectFolderDialog component is design much like other dialog components in that the Execute method returns a Boolean indicating whether or not the user clicked OK or Cancel. Therefore, you can do something like the following to determine if the user clicked the Cancel button:

Code: Select all
procedure TForm17.RzButton1Click(Sender: TObject);
begin
  if RzSelectFolderDialog1.Execute then
    ShowMessage( 'Selected Folder: ' + RzSelectFolderDialog1.SelectedPathName )
  else
    ShowMessage( 'Selection Cancelled' );
end;


Ray
Raize Software Support
Raize Software
http://www.raize.com
Raize Support
 
Posts: 604
Joined:
Fri Mar 25, 2011 9:04 pm


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron