How to addjust the size of the form to the size of the HTML content.

When I create a Modal form with TMS Web Core and Bootstrap, the components I've inserted accommodate his aspect to the aspect of the ecomponents in the HTML.

But the form itself doesn't do this. Or I didn't find who to do it.

Does anyone know how I can set the dimensions of the form to the dimensions of the HTML of the form?


At this moment, the form does not have a published design-time setting for this.
We'll consider publishing a WidthStyle / HeightStyle property to TWebForm.
For now, you might try to use this in code to set it to ssAuto

I understand that, at this moment, I can't.
Then, how can I make my modal form scrollable?

Finally, I found this solution:

procedure TEditUserForm.WebFormDOMContentLoaded(Sender: TObject);
var Element :TJSHTMLElement;
   Element := document.getHTMLElementById('ContentWrapper');

   Self.Height := Trunc(Element.offsetHeight);
   Self.Width  := Trunc(Element.offsetWidth);

I assign id="ContentWrapper" to a div that involves all the HTML content.

1 Like