Hi,
I am trying to put this html/javascript code into c# webbroswer control but it shot on script error.
This is the javascript code:
var gainerTick = new WBIHorizontalTicker('gainers');
gainerTick.start();
var loserTick = new WBIHorizontalTicker('losers');
loserTick.start();
and this is what I wrote in my c# form init function:
webBrowser2.AllowNavigation = true;
webBrowser2.AllowWebBrowserDrop = false;
webBrowser2.IsWebBrowserContextMenuEnabled = false;
webBrowser2.WebBrowserShortcutsEnabled = false;
webBrowser2.ObjectForScripting = this;
webBrowser2.DocumentText =
" " +
" " +
"" +
"";
if someone can help, it would be great
thanks
17 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
ramya bharathPosted May 29, 2015, 4:08 PM
ramya bharathPosted Jun 3, 2015, 4:02 PM
ramya bharathPosted Jun 3, 2015, 4:01 PM
The SendKeys class has been updated for the .NET Framework 3.0 to enable its use in applications that run on Windows Vista. The enhanced security of Windows Vista (known as User Account Control or UAC) prevents the previous implementation from working as expected.
The SendKeys class is susceptible to timing issues, which some developers have had to work around. The updated implementation is still susceptible to timing issues, but is slightly faster and may require changes to the workarounds. The SendKeys class tries to use the previous implementation first, and if that fails, uses the new implementation. As a result, the SendKeys class may behave differently on different operating systems. Additionally, when the SendKeys class uses the new implementation, the SendWait method will not wait for messages to be processed when they are sent to another process.
If your application relies on consistent behavior regardless of the operating system, you can force the SendKeys class to use the new implementation by adding the following application setting to your app.config file.
To force the SendKeys class to use the previous implementation, use the value "JournalHook" instead.
Refer the link below
shlomi gadolPosted Jun 3, 2015, 1:14 AM
ramya bharathPosted Jun 3, 2015, 12:45 AM
shlomi gadolPosted Jun 2, 2015, 4:51 AM
ramya bharathPosted Jun 1, 2015, 3:21 PM
shlomi gadolPosted Jun 1, 2015, 9:30 AM
ramya bharathPosted Jun 1, 2015, 12:57 AM
shlomi gadolPosted Jun 1, 2015, 12:17 AM
ramya bharathPosted Jun 1, 2015, 12:14 AM
shlomi gadolPosted May 31, 2015, 11:58 PM
ramya bharathPosted May 31, 2015, 7:00 PM
shlomi gadolPosted May 30, 2015, 2:12 AM
shlomi gadolPosted May 30, 2015, 1:36 AM
shlomi gadolPosted May 29, 2015, 3:46 PM
ramya bharathPosted May 29, 2015, 3:25 PM
webBrowser2.DocumentText =
" " +
" " +
"" +
""
webBrowser2.DocumentText =
" " +
" " +
"" +
";
Hope it works now
Refer this
https://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.objectforscripting(v=vs.110).aspx