Dynamically sizing a WebDialog

Either this is a bug or I don’t know the “correct” way to do it, but I want a WebDialog to be sized dynamically when shown based on the window/webpage size.

This code will basically break the dialog (called from a WebPage):

dim wd as new WebDialogClass wd.width=self.Width-100 wd.Height=self.Height-100 wd.Show

If the change to width/height is before the wd.Show, it breaks everything. If the change is after the wd.Show, it will simply change the size of the overlay that darkens all other windows as well as the centering, but will not change the actual dialog’s size. If you put the resizing into the WebDialog’s shown event nothing seems to resize and it throws up a JS error.

I found this…

But I can’t imagine that the ability to simply resize WebDialogs has been broken for over a year without any fix…

I reported it in <https://xojo.com/issue/31302> last month. The one you cite seems to indicate a different problem, or at least wasn’t clear as to the problems.

Thanks Jay. Did you ever find a workaround for a way to simply resize the WebDialog properly?

I was going to dig into the DOM and try to manipulate the size via ExecuteJavascript. But because I didn’t need infinitely dynamic dialogs, but just a few different sizes, I decided on just building a few different sized dialogs and choosing the appropriate one.