Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

refreshing the parent form when the child form closes (windowsapp)

Status
Not open for further replies.

tekkerguy

Programmer
Nov 16, 2005
196
US
I have a windows app that has pull down menu listing some items for a user, and a button which opens a new window to allow the user to enter a new item.

In this window, the user is asked for some text input.

When the user clicks on the submit button, the function puts that data into an xml file and closes the window.

What I want to happen next, is that the pull down menu refreshes with the newly entered item in it.

How do I do this?

 
I would assume the pull down menu options are added at runtime initially. So I would also assume you have a function that reads the xml to retrieve these items and then adds each to the pull down menu collection list.

So when the window is closed how about removing all the items from the pull down menu and then call the method that reads the xml to update the pull down.



 
That was also what I was thinking, the question though is, how do I inform the parent window that the child window has closed, so that it reloads the pull down. It's probably an event handler that needs to be setup, I just don't know where to set that up.

 
If it is opened modally, then line immediately after the call to open the window will not be executed until the window is closed.


Hope this helps.

[vampire][bat]
 
What I did was I set up a .FormClosed Event Handler.

It was firing, however, the combobox still wouldn't refresh. Turns out it was, but I wasn't reinitializing the object from which it was pulling it's data. So I reinitialized that object and then refreshed the combobox, and it worked.

Thanks for all the tips!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top