|
Rank: Advanced Member Groups: Member
Joined: 10/10/2016 Posts: 35
|
Hi EO,
I have one question need your help.
I will change my HTML page size by using CSS. And I want to resize my winform by using GetPageSize function. But if my new size smaller than old size(eg: new size - 300 * 600, old size - 1000 * 600), I can't get new HTML page size by using GetPageSize function(still 1000 * 600). Although I can do it by another way, but I think I need to let you know this problem. Could you please help to take a look?
Thanks & Regards, Qiang
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
GetPageSize gets page size through document.body.scrollWidth and document.body.scrollHeight. There are a lot of factors that can affect these two values. For example, one can code the HTML page to automatically adjust to fit the window size, or one can have JavaScript in the code that dynamically changes the content size. So if those two values do not reflect what you expected, you can either modify your page or use another way to do it.
Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 10/10/2016 Posts: 35
|
Hi EO,
I have one more question.
I will change the size of Winform in order to accommodate the size of HTML page. If the size of modified Winform smaller than the size of original Winform, the Webview will have a blank moment. Is there any way to fix this problem?
Thanks & Regards, Qiang
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
What do you mean by "blank moment"? Do you mean the page appears as blank (white) for a period of time? That will depends on your page. If your page has code that handles resize event and that take a long time, then you may see blank when that code runs.
Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 10/10/2016 Posts: 35
|
Hi EO,
Yes, I mean the page appears as blank (white) for a period of time.
I am sure that my code will not take a long time, it's very quick in Chrome. I would like to know if there is any way to know that the WebControl has changed? So that I can render the new page. I try to use "SizeChanged" event in EO WebControl, but it seems that Winform and WebControl are not changing the size at the same time. If I increase the size of html page and Winform at the same time, the html page will first appear with a scroll bar, and then disappear with the WebConrol increases.
Thanks & Regards, Qiang
|
|
Rank: Advanced Member Groups: Member
Joined: 10/10/2016 Posts: 35
|
Adding Picture: Render Finished, WebControl displays incorrect: After about 0.5 seconds, WebControl displays correct:
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Yes. This is not ideal but normal. Due to the fact that we have to synchronize the sizes between the .NET world and the native browser engine, it does create some time delay especially if you have an onsize handler in your JavaScript code. Unfortunately there is no way to avoid this delay. Sorry about it!
|
|
Rank: Advanced Member Groups: Member
Joined: 10/10/2016 Posts: 35
|
Hi EO,
Thank you for the explanation.
I would like to know whether EO will add an attribute to let us know when the WebControl to adjust the end? If you add this attribute, I can re-render the page after the WebControl has been adjusted.
Thanks & Regards, Qiang
|
|
Rank: Advanced Member Groups: Member
Joined: 10/10/2016 Posts: 35
|
Hi EO,
Please let me know if you have any updates for this problem.
Thanks & Regards, Qiang
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
We do not have any plan to add this because it is not practical. The browser engine can fire resize event any time, some of them can be triggered by you, some of them can be triggered by the system. So there is no "end" to this event --- it just comes and goes. Both Windows system and the browser engine are optimized to delay UI refresh when it's busy with other things. Further more, the general rule for a web page is the page adapt to fit the browser window, not the other way around. If you try to make the browser window to fit the page, you can run into a lot of problems --- for example, the page can detect browser window resize and then resizes itself, then you will get into an infinite loop of resizing each other. So you should not rely on such "end" events and try to do more things to "fix" it.
Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 10/10/2016 Posts: 35
|
Ok, thanks very much.
|
|