On Closing A Form Reload Another Form?
Jun 22, 2010I'm developing a window-based application where I've a Main Form A. I open another form B on a button click. When I close Form B, I want to reload the Form A.
View 5 RepliesI'm developing a window-based application where I've a Main Form A. I open another form B on a button click. When I close Form B, I want to reload the Form A.
View 5 Replieshow I can reload a windows form without closing it using VB.NET?
View 3 RepliesI need to reload the form of my application. The application has only one form vb.net 2005. I need a button that will call the page_load event so I can restart and reload all my settings. basically I need to call the Sub private Page_load event().I just need to force the reloading of the form without having to close it and reopen it.This is the code which I need to reload:
Public Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
For Each URLname As String In My.Settings.URLtoTrackCollection
URLtoTrack.Add(URLname)
[code]....
How can i actually reload a form without actually closing it and re-opening it?By using a button click?
View 34 RepliesI am building an app with multiple forms. It has a MainForm, which is the main interface, and several sub-forms that are started using buttons on the MainForm.
The MainForm Load method has some code that runs each time the form starts. This code populates various fields in the MainForm and it works fine. When I click a button a sub-form loads. I update some data there and then close or hide this form.
My problem is this: When I close or hide the sub-form and show the MainForm again, is it possible to have the MainForm Load method 're-run', or execute again? I presume I might be able to add something to the sub-form "Back" button event that runs when I hide or close the sub-form. I've tried a few variations of "frmMainForm.this" and "frmMainForm.that" with no luck.
I want to do this because the MainForm Load code will pick up the changes I made in the sub-form and display the updated data in the text fields of the MainForm.
Dim frm As Form
For Each frm In Forms
Set frm = Nothing
Next frm
The above code is what I used in VB6 to close all forms associated with my programs before my program closed. I have been searching for information on how to make sure all forms are closed when closing a VB2008 program.
I have seen info on using the Project Property Shutdown mode When startup form closes and I currently have this set.
Is this all that is really necessary? Will the garbage disposal close everything else to free up RAM?
Also, if I have several forms open and want to close all from the main form without closing each one individually, what is the best approach? Is there a collection like in VB6, go through the collection, compare it to the name of the main form and close it if it is not the main form?
Alright, I have a vb6 LEGACY application and new Functionality (Form) written in c#. I have a VB.NET COM Class as a wrapper. I can launch the .NET Form just fine. THe problem I am having is closing the .net form from vb6.
Example:
In VB6, I have something like this:
CODE:
But it does not work becuase frmViewer is Nothing for some reason. how I should close the .NET form that was launched from VB6?
I have a parent form that has a list of items and each item has a unique ID. The user can open one or many of the items in a child form (it is set up in a tabbed MDI), but it can only open one instance of each item at a time.
In the parent form, I was going to make a collection (or something like that, maybe there is a better way) to keep track of which items are open in the child forms. I need to know when each child is closed so that it can be removed from the collection and reopened at a later time. I was thinking that when the child form closes, it somehow does something (like raise an event) that tells the parent form to remove the unique ID from the list of current open child forms.
My questions are, is this a good way to do this and I am pretty sure I would use the form closed event in the child form to update that parent form, but as well, I didn't know if this is the best way of handling it.
If raising the event is a good way, are some examples on how to do it out there? I found some for controls, but not while the form is closing/closed.
I have the following code to close a form which is a child. The problem is that when it closes, it closes the MDI parent too.
Private Sub frmTransaction_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
If ListView1.Items.Count >= 1 Then
[Code]....
I need to call again my gameplay form after finishing 1 stage. I'm just doing the normal calling. Me.Close() then Object.Show(). (Object is the object of gameplay form). The problem is, there is a continous loop of the form its flashing. It's like it's showing then closing again ang again non stop. What should I do? Or is there another way of calling again my gameplay form?
View 1 RepliesI have 3 forms.....when i make changes in the form 2 ...i want to reload the form 1 so that it reflects the changes in the database..
View 1 RepliesHow can i reload/refresh the same form again without losing the data stored along with the form?
View 3 Replieshow can i reload my form in vb9?
View 3 RepliesI am working on a project that has the user building scrapbook pages through several different forms. When the user selects something a presses a button I have the information about the selection load to a list box which is on a CheckoutForm. One of the options I have is for the user to save what they have made (this includes the information in the list boxes) and return to a previous form to build another page. I have been trying to use the Me.Close() but it does not save the information and using Me.Hide() displays the wrong elements on the forms.
View 5 Repliesi have a parent form which is having a grid view. In the KeyDown event of the grid view i am calling a child form. If the user closed the child form, my application should close both the parent form and child form. What i have done is, i declared a boolean in the child form and passed the boolean value to parent. May be the code below will give the picture of what i am trying to do.
Private Sub gvJournalEntryDet_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles gvJournalEntryDet.KeyDown
I have a unique challenge that I just cannot seem to get by...I have a form with a series of listboxes that allows the user to rename items in the listbox (I probably should be using a listview control instead). When the user right-clicks and selects rename from the context menu I show a simple form with two labels & text boxes showing the selected list box item in one textbox...the other is blank waiting for the user to enter a new name. What I'd like to do is when the user closes the rename form, the information is passed back to the calling form and a listbox refresh method is fired to show the changed name. Couple question:
First, is there an easier method to implement the renaming concept in a listbox (probably should be using a list view) i.e., have I overcomplicated things?
I have 2 forms. When a user clicks something on form1, form2 pops up. After user is done with form2 and closes it (where the dataset is updated), I want form1 to "reload" the dataset to reflect changes made in form2.
View 1 RepliesIs there a way to force a form to reload itself? The reason I ask is I have a listview that shows the data from my database. You can add information to the database from another form but when you go back to that form the information is not updated because the information updates on the form load. So my question is there a way to just do the form_load event again?
View 1 Repliesi am trying to create a simple game as homework from my school. now i just stuck on one stage. see the picture on this link how it looks like.[URL]
i have created a module here is the code for module file
Module Module1
Public Sub bknapper()
'create button on fly
[Code].....
possible to reload a form to its original state?i.e all pictureboxes, labels, functions are back the way they were when the form loaded.
View 1 RepliesIs it possible to reload a form of the running application from one computer when I executed a function from my other computer with the same application? co'z I want to see the changes of data on my datagrid view
View 1 RepliesI have a form with a browser inside. When loading this form I set the browser.navigate to a url.Now to display this form I used the: form. ShowDialog()to have the form modal (which is what I want).But now when I close this form and reopen it, the browser doesn't refresh (the navigate doesn't start)this is beacuse closing a Showdialog() form doesn't unload it from the memory. To empty the memory I used the.[code]It closes and when reopened it reload the page, but it's not modal anymore and also closing the main form doesn't close this form.So what I would like is to have the form with the browser modal, but every time I load it, it should navigate to the url set.
View 8 RepliesI am using Vb 2008 Express Edition. I have only 1 form with 10+ arrays. My app runs a few calculations and finally plots 2 graphs. The first time I run my program, everything works fine. But when I run my app with a new set of data it gives me the wrong results. Is there a way I can force my form to reload itself and act as if its running for the first time? I know I can do an Application.restart. But I don't want to restart my app every time.
Me.Refresh() doesn't work, as my form still seems to remember my old data set (array)
My program is only one form, at a certain point I want the form to reload, and have all the variables and arrays be reset? I am able to to reload the form by:
Dim frm As Form
frm = New frmMain
frm.Show()
But the original form still stays open? My program is a version of blackjack. when who won or lost is figured out i want all the cards to clear (held in an array of picture boxes) I have random numbers generated (also put into an array) each random number then finds the image of the card it belongs too and then places it into the array of picture boxes. How to reset the arrays so I thought maybe trying to just reload the form would work?
How can i reload/refresh the same form again without losing the data stored along with the form?
View 1 RepliesBasically I have a form which is used for a report, when completed it is then mailed to various mailboxes. I would like the option that if the user cannot complete the form, they can save it & reload the values into the form to use later.Some of the boxes will have quite a lot of text, so using the registry is not an option. I have looked at My.Settings but think this is for application settings not user input such as a lot of text - but I could be wrong.I've looked at freefile & got it to work with text boxes saving to a .dat file, but had a problem in that text appeared in the wrong text boxes so I assume the order was different in the load to what it was in the save?
View 2 RepliesI have several labels that bind to my query adapter and I need to update (not TO the database but FROM the database) as data changes on database by another application.I only need to either check data on my database that changed or reload the data.I'm using data set, table adapters and tableadapter.queryadapter to query data (tantalization) from my database.all I want is to refresh/ update this values on my controls in my windows form I'm using VB.NET on VS2010.
View 12 RepliesI have this form called gamePlay form. This form is showed by my loading form. When the gamePlay form is showed the loading form is closed. At the gameplay form i will be opening another form called congrats form. At congrats form I need to close the gamePlay form. How should I close the gameplay form from the congrats form. I tried creating an instance of the gamePlay form and obviously the gamePlay form won't close since the instance that opened gamePlay was not the one who closed it. I know it's a bit confusing.
[Code]...
I want to reopen a form that was by the main form. Not sure how this can be done noobie programmer.
I Have A Main form that opens up two other forms but it will hide when one form is opened. I want to know how to reshow this form main form when the other form is closed by using the red X at the top right of the window.
I'm looking for some code that will reload a form, so its like a Restart Level button which when clicked will reset the form to its original look.
View 1 Replies