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)
{
}
}
Dag Hammarskjold
05-Oct-2013First, in form1.designer, change this line of code:
to:
now, in form1 button_click:
solution II: In form1:
In form2: