I have a web page which I’m embedding a container on at run time.
When I’m embedding the container using EmbedWithin, I’m using the webpage width and height values (with a bit of a margin etc). However the webpage size has started reporting it’s width and height as the design time sizes not the actual sizes.
I’m setting the embedded containers lock left, right, top and bottom and the embedded container resizes to the actual page sizes but when I want to do a bit of manually resizing on other controls, both the page and the embedded container still report the webpage’s design time width and height.
This was working as expected but has stopped and I have no idea what has set it off and now I’m stuck.
I’m trying to get the size of the Page which has been resized and shown. I’m trying to use the size of the page to resize other objects.
The problem is, this doesn’t happen if you have a simple project and I don’t know what sets it off so difficult to create a sample project! I was hoping for some insight.
Did you download & look at my project link? It’s a simple project that shows the size of the page in both the Open & Shown events.
Or are you looking to resize your objects after the browser window has been resized by the user? In which case you’ll need to add a resized event to your webpage.
It’s not about the events. The main page resizes to the browser and the user starts using the app. So minutes go by! Then they click a button and I want to resize a control. But the page size is being reported as the design time size not it’s actual size.
I get the browser’s window size. Not the original 600x400 design size.
But when the same code is placed in the container resized event, it reports very strange values, neither the actual size of the instance, nor the size of the container, and certainly not the size of the web page.
The best workaround I can think of is to set properties on the web page like myWidth and myHeight you update in WebPage.Resize, so you have the right values from within the container.
I get the browser’s window size. Not the original 600x400 design size.
But when the same code is placed in the container resized event, it reports very strange values, neither the actual size of the instance, nor the size of the container, and certainly not the size of the web page.
The best workaround I can think of is to set properties on the web page like myWidth and myHeight you update in WebPage.Resize, so you have the right values from within the container.[/quote]
Please file a bug report about that.
I had forgotten this issue I made the bug report <https://xojo.com/issue/37862> for, and today, tried to get the size of the browser from within a web container ; Boom. The browser window was over 2000 wide, while my poor iMac 2011 cannot display more than 1920