Jump to content
Tom F

TSaveDialog is not resizable with Styles

Recommended Posts

When using a style (e.g.Windows10), the dialog that is displayed by the code below is not resizable. (i.e. There is no handle in the lower right corner with which to drag the window larger.)

When using the default Windows style or removing the Options line from the code, there is no problem.

We had hoped to start using styles in our app, but a bug like this is discouraging. 

 

var
  SaveDialog1: TSaveDialog;
begin
  SaveDialog1 := TSaveDialog.Create(Self);
  SaveDialog1.Options := [ofOverwritePrompt]; // removing this line eliminates the problem
  SaveDialog1.Execute;
  SaveDialog1.Free;
end;

Windows 10, D11.1, 32-bit app. Reported here https://quality.embarcadero.com/browse/RSP-38868

 

Edit:  I decided to add a screen capture showing the missing grab handle to resize.  I've noticed that when using a style, the dialog box that is missing the grab handle is a different type. It has icons on the left rather than a directory tree.  It appears that the VCL Styles changes the dialog box type.  What's the difference?  Is there a way to show the "old style" (with a tree) when using styles??

image.thumb.png.ffcc2b8a8e170cd0958e0960ea5d2f3d.png

Edited by Tom F

Share this post


Link to post
On 8/13/2022 at 3:56 PM, Tom F said:

Is there a way to show the "old style" (with a tree) when using styles??

You can add the following line e.g. in the OnCreate of the main form:

 

TStyleManager.SystemHooks := TStyleManager.SystemHooks - [shDialogs];

VCL.Themes needs to be in the uses list. The drawback is, that the style is also removed from all message dialogs. But I find it easier to make your own message boxes than your own file dialogs.

Share this post


Link to post
On 8/13/2022 at 3:56 PM, Tom F said:

Is there a way to show the "old style" (with a tree) when using styles??

Actually, the tree style dialog is the new one. The drawback of the new ones is that they cannot be styled, because they are completely handled by Windows.

TSaveDialog tries to use the newer dialog when possible. With styles active it is just not possible and the old style dialogs are used.

Besides the hint from Renate you can force the (unstyled) new dialog when you replace the TSaveDialog with a TFileSaveDialog.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×