TTMSFNCTaskdialog: titCustom -> Client size

Hello,

If I use TTMSFNCTaskdialog with InputType := titEdit, the TaskDialog has a certain size.
However when I use titCustom with a Panel for example, the TaskDialog will size itself according to the panel size.
I would like the opposite: the width of the panel should resize according to the width of the TaskDialog.
However when I checked the TaskDialog.Width and Height at runtime, both were 26.

I tried different Panel.Align e.g. client , top etc. but they distorted the size of the TaskDialog.
The reason I don't want to give the Panel a fix size that on different Android screens I might have different results.

Is there a way to do this? Thank you very much!

Hi,

There is no built-in way to have the dialog handle the size of the custom control. Simply because the default expectation is to have the assigned custom control displayed as-is. You can define the minimum and maximum dialog width but that won't help in this case.

When you say the dialog has a certain size if InputType is := titEdit, then it's most likely the MinDialogWidth is being used. You probably don't have enough buttons to
influence the width of the dialog so it just remains at the minimum width.

I suppose one possible improvement could be to resize the custom control if it exceeds the MaxDialogWidth property (as it's currently not doing that) but then you'll need to make sure to have the correct MaxDialogWidth per platform or screen size.

For now you'll need to pick your panel's width and height (to maintain ratio) based on the form width to make sure it fits into the dialog. We'll look into the possible improvement regarding to MaxDialogWidth.

1 Like

Thank you very much, Tünde!