set doc=webbrowser1.document
How to get the size (width and height) of webbrowser1 through this doc?
I use the following method to obtain it. Sometimes it is correct and sometimes it is 0. What is going on?
doc.body.offsetwidth doc.body.offsetheight
doc.documentelement.clientwidth doc.documentelement.clienttheight
When fetching, it depends on whether the document has been rendered. It is best to get the value in the loaded event.
When fetching, it depends on whether the document has been rendered. It is best to get the value in the loaded event.
Anyone else answered? No more stickers.
My own solution: Since the code is used in the class, setting the width and height of the webbrowser during instantiation can solve the problem.