We have a summary view in our winform application that uses the WebBrowser control to display summary information from a web page. We use this to get a rich tabular layout that we would not be able to accomplish using standard winform controls. when you first view the view on the client, it takes some time to deploy (running IE in the background, which I assume), and the application freezes for several seconds. I am considering some kind of preboot mechanism that runs IE in the background and would like some community tips.
I am considering launching off-screen or in an invisible form using a web browser control when starting the application or launching an IE instance in some kind of side stream when starting the application.
any suggestions?
You can preload controls during application launch in a separate thread. Pay attention to the state of the STA apartment, which is mandatory if you want to manipulate some COM objects (for example, WebBrowser).
public static class ControlPreloader { public static void PreloadAsync() { var thread = new Thread(Preload); thread.SetApartmentState(ApartmentState.STA); thread.Start(); } private static void Preload() { using (var hostForm = new Form()) { var control = new WebBrowser(); hostForm.Controls.Add(control); control.CreateControl(); hostForm.Close(); } } }
, , , , about:blank. DocumentCompleted URL. , " IE", .
about:blank
DocumentCompleted
, , , " " , , WPF ( WinForms), .
Source: https://habr.com/ru/post/1751040/More articles:how to replace all links in text with regex in as3? - stringHow to extract information from an object created by JavaScriptSerializer - jsonWhat are your LS_COLORS? - linuxI cannot install Haml / Sass on Windows using RubyInstaller for Windows - windowsHow to link text with ActionScript 3 - regexCompiling assembly code - assemblyGet the calculated opacity of an element using jQuery - jqueryAttach a database using SMO keep Fail - sql-serverHow to check email sending from a web application in OSX? - djangoThe difference between PowerShell and MSBuild - powershellAll Articles