0

On my form, I have a webbrowser, that navigates to nothing on start. But on webBrowser navigated I have this code, but the msbBox keeps showing on start up.

if (webBrowser1.DocumentText.Contains("Hello"))
            {
                this.Text = "iUltimate - Cheating Zone - " + txtUser.Text;
            }
            else
            {
                MessageBox.Show("Error, please try again. This might be caused by misspelling your username or pass. Only V.I.P. Members can sign in.");
            }
4
Contributors
6
Replies
7
Views
6 Years
Discussion Span
Last Post by GAME
0

Code should be,

if(SearchButtonIsClicked){
            if (webBrowser1.DocumentText.Contains("Hello"))
            {
                this.Text = "iUltimate - Cheating Zone - " + txtUser.Text;
            }
            else
            {
                MessageBox.Show("Error, please try again. This might be caused by misspelling your username or pass. Only V.I.P. Members can sign in.");
            }
 }
0

The SearchButtonIsClicked... doesnt seem to work even with my button name.

0

Even though you don't navigate anywhere, for some reason the webbrowser control fires the navigate even to no-where.

What adatapost is trying to say is that you should check to see if your button has been clicked and only execute your code if it has.

0

Thank you guys for all your effort... I used adatapost method and checked if a button was enabled.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.