unable to get webbrowsers ready state

In my app i need something to happen when the page is loaded so i added the following code and made an if statement

if (webBrowser1.ReadyState = WebBrowserReadyState.Complete)
 
and I thought it would work but i get the error

Error    1    Property or indexer 'System.Windows.Forms.WebBrowser.ReadyState' cannot be assigned to -- it is read only    C:\Documents and Settings\MyName\Desktop\C#\Affiliate\Affiliate\Form1.cs    31    17    Affiliate
 
and so i guess that maybe i should try to read it, but first the second error incase its important...
 

Error    2    Cannot implicitly convert type 'System.Windows.Forms.WebBrowserReadyState' to 'bool'    C:\Documents and Settings\MyName\Desktop\C#\Affiliate\Affiliate\Form1.cs    31    17    Affiliate
 
and so i put the following code in the same method but then the compiler starts complaining about tons of code that was fine just a little bit earlyer, and i tried moving it everywhere.

public WebBrowserReadyState ReadyState { get; }
 
any ideas of what is happening or what i could do



Answer this question

unable to get webbrowsers ready state

  • Riiii

     wow amateur error in the code

    class="txt4">if (webBrowser1.ReadyState = WebBrowserReadyState.Complete)
     
    i was useing "=" instead of "==" PS: for some reason the forums freaking out so you might see some wierd extra text because of my browser ad ons.

  • unable to get webbrowsers ready state