如何获得webbrowser网页里某元素所占用的位置坐标
展开全部
用getBoundingClientRect方法获取 :
引用mshtml;
IHTMLDocument3 document = (IHTMLDocument3)WB1.Document.DomDocument;
IHTMLElement2 ele3 = document.getElementById("DIV的ID") as IHTMLElement2;
MessageBox.Show(ele3.getBoundingClientRect().top.ToString() + "," + ele3.getBoundingClientRect().left.ToString());
引用mshtml;
IHTMLDocument3 document = (IHTMLDocument3)WB1.Document.DomDocument;
IHTMLElement2 ele3 = document.getElementById("DIV的ID") as IHTMLElement2;
MessageBox.Show(ele3.getBoundingClientRect().top.ToString() + "," + ele3.getBoundingClientRect().left.ToString());
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询