c# - Adding a image element to a webbrowser control page (existing site) -
i'm trying create element image windows forms webbrowser control existing site. want move created element position. have code, doesn't work.
private void webbrowser1_documentcompleted(object sender, webbrowserdocumentcompletedeventargs e) { webbrowser1.document.getelementbyid("gpu_notice").style = "display:none"; webbrowser1.document.getelementbyid("header").outerhtml = ""; webbrowser1.document.getelementbyid("ads").outerhtml = ""; webbrowser1.document.getelementbyid("the_game").style += "position: absolute; top: 0px; right: 0px;"; htmlelement logo = webbrowser1.document.createelement("logo"); logo.setattribute("src", @"c:\users\susana\documents\projeto haxballk\design\logo hk.png"); webbrowser1.document.body.appendchild(logo); logo.setattribute("float", "right"); }
is task inserting element existing html document displayed webbrowser
class? if yes, steps (not tested, sorry)
- download document using
webclient
html string - make
<body>
relative in html string (insertstyle='position: relative'
<body>
element) - insert element html string, after
<body>
, make element absolute (settingstyle='position: absolute; left=...; right=...'
- set modified html string
documenttext
property ofwebbrowser
class
Comments
Post a Comment