When I have a form that second time, I say "is not able to reach a settled keep getting an error object went opening created at runtime. "" object name 'form' here's the code of the function. it is called by the Button event I saw everything on the net and found people with the same problem, though I reforms Have tried and none of them work Do not know how to fix this problem. VS Line highlights on frmFavorites.Show ();
Thanks in advance
public zero FrmMyBrowser_ShowFavorites (Object Sender, EventArgs e) {frmFavorites.ShowIcon = False; FrmFavorites.ShowInTaskbar = false; FrmFavorites.Text = "Bookmark"; FrmFavorites.Width = 500; FrmFavorites.Height = 320; frmFavorites.Controls.Add (lstFavorites); Frnfvoriteskkantrolskaed (Btnaremovefvorite); Frnfvoriteskkantrolskaed (Btnddfvorite); Frnfvoriteskkantrolskaed (Tshtkurrenturl); Lsfvoriteskvidth = 484; Lsfvoriteskhait = 245; BtnRemoveFavorite.Location = New point (397, 255); BtnAddFavorite.Location = new point (8, 255); TxtCurrentUrl.Location = New point (110, 255); TxtCurrentUrl.Size = new size (265, 20); BtnAddFavorite.Text = "Add"; BtnRemoveFavorite.Text = "Remove"; TxtCurrentUrl.Text = wbBrowser.Url.ToString (); BtnAddFavorite.Click + = new event heredollar (BTNEdFeSword_click); BtnRemoveFavorite.Click + = new event handler (BTNRMVForce_click); FrmFavorites.Load + = new event handler (frmFavorites_Load); FrmFavorites.Show (); FrmFavorites.FormClosed + = New FormClosedEventHandler (frmFavorites_FormClosed); Stream Reader Reader = New System.io.StreamRadder (@App.startuppath + "\\ favorites.txt"); {While (Reader.EndOfStream) {for (int i = 0; i <4; i ++) {string strListItem = reader.ReadLine (); If (String.IsNullOrEmpty (strListItem)) {lstFavorites.Items.Add (strListItem); }}} Reader.Close (); }} Public Zero btnAddFavorite_Click (Object Sender, EventArgs e) {lstFavorites.Items.Add (wbBrowser.Url.ToString ()); } Public void btnRemoveFavorite_Click (object sender, EventArgs e) {try {lstFavorites.Items.RemoveAt (lstFavorites.SelectedIndices [0]); } Hold {Messagebox.Show ("You must select an item", "Error"); }} Public void frmFavorites_Load (object sender, EventArgs e) {} public void frmFavorites_FormClosed (object sender, FormClosedEventArgs e) {StreamWriter writer = new System.IO.StreamWriter (@ Application.StartupPath + "\\ favorites.txt"); {(Int i = 0; i & LT; lstFavorites.Items.Count; i ++) of {writer.WriteLine (lstFavorites.Items [i] .ToString (to)); } Author. Stop it (); } FrmFavorites.Close (); }
You can not open the closed form again. When a form closes (1) it is dealt with and (2) the underlying operating system window handle is free.
I think you can be the constructor of the form Be able to take the contents of it and put it in a method that you can call to reopen the form, but I will not really recommend this. This works by doing so. Instead, just make a new example.
Comments
Post a Comment