Good Day everyone,
I am writing my own web browser, just for something to do.
I am able to surf the web and all with it but when i try to add a history form i crash.
Well it works the first time and does record my history BUT as soon as i close the history window and try to open it again, well i crash. Heres the Error that i keep getting.
and here is the code that i wrote.
Everything in red has to do with the code in question.
Any help is appreciated.
Thanks in advance
L4gspike
I am writing my own web browser, just for something to do.
I am able to surf the web and all with it but when i try to add a history form i crash.
Well it works the first time and does record my history BUT as soon as i close the history window and try to open it again, well i crash. Heres the Error that i keep getting.
C#:
ObjectDisposedException was unhandled
C#:
An unhandled exception of type 'System.ObjectDisposedException' occurred in System.Windows.Forms.dll
and here is the code that i wrote.
C#:
public partial class frmBrowser : Form
{
public frmBrowser()
{
InitializeComponent();
}
[COLOR=#b22222]public History frmhis = new History();[/COLOR]
private void NavigateToPage()
{
//takes url from toolbar text box and navigates to webpage
txtURL.Enabled = false;
btnGo.Enabled = false;
wbBrowser.Navigate(txtURL.Text);
txtURL.Items.Add(txtURL);
txtStatlbl.Text = "Navigation has started";
[COLOR=#b22222] frmhis.lstHistory.Items.Add(txtURL.Text);[/COLOR]
}
C#:
[COLOR=#b22222]private void historyToolStripMenuItem_Click(object sender, EventArgs e)[/COLOR][COLOR=#b22222] {[/COLOR]
[COLOR=#b22222] frmhis.Show();[/COLOR]
[COLOR=#b22222] }[/COLOR]
Everything in red has to do with the code in question.
Any help is appreciated.
Thanks in advance
L4gspike