forum

Home / DeveloperSection / Forums / How can I call webbrowser from another form c#

How can I call webbrowser from another form c#

Mark Devid291405-Oct-2013

I took two form (form1 & form2) in my program. in form1 i took a button & in form2 i took a webbrowser.i want to run webbrowser on form2 by clicking on form1 button.

but my program not working.

Please help me, how to do this currently.

this is my program code:


public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
    }
    private void progressBar1_Click(object sender, EventArgs e)
    {
    }
    private void button1_Click(object sender, EventArgs e)
    {
        try
        {
            webBrowser1.Navigate(textBox1.Text);
        }
        catch(Exception)
        {
            MessageBox.Show("Connect to Internet First","Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
        }
    }

    private void Form1_Load(object sender, EventArgs e)
    {

    }
}



Updated on 05-Oct-2013

Can you answer this question?


Answer

1 Answers

Liked By