c# - InvalidCastException when not casting -
I am using the winforms I do not understand why I see this error because I am not casting anybody And casting is not necessary because these variables like the value of the same type. Anyone put some light on this? Code below: Edit: Why do not you just subscribe to an event instead of using a loop? Webbrowser control to load a webpage, and for this Waiting for the page to load. So I have a time loop that checks the
ReadyState property, but it's a
InvalidCastException Throwing
while (wb.ReadyState! = WebBrowserReadyState.Complete) {Thread. Sleep (2500); }
Private zeros wb_DocumentCompleted (Object Sender, EventArgs E) {// stuff after loading page}
Comments
Post a Comment