|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to detect when ShowDialog object has closed? (2003)Here's the problem.
On my OrderForm the user can click a link to open up the AddCustomer form to add a new customer, when AddCustomer form closes, it saves the customer to the DataBase. The AddCustomer form is currently opened as a Modal form using ShowDialog. At the moment to see the newly added customer (in a ComboBox)I have to click a button to close, then re-open the OLEDbConnection, re-fill the DataSet then call the ComboBox fill method again. How do I enable it so these commands are done automaticaly when the AddCustomer form closes? Bear in mind that the AddCustomer form can itself be also loaded from the MainMenu. I tried the OrderForm's Got_Focus event but that doesn't work. Any ideas? Aziz as i understand ur problem, use datasets for this purpose. When
the record is inserted successfully, return its result as dataset and add the value in the combobox otherwise dont insert it. My fault for not being more clear.
Basically what I want to know is if I Open Form2 from Form1 using ShowDialog, how can Form1 know when Form2 has closed? Aziz,
When you show the form with ShowDialog your code waits until the shown form is closed and then continues with the next line of code after the ShowDialog. So after the line of code that shows the form, have a line of code that clicks the button that you are currently clicking manually. Kerry Moorman Show quoteHide quote "Aziz" wrote: > My fault for not being more clear. > > Basically what I want to know is if I Open Form2 from Form1 using > ShowDialog, how can Form1 know when Form2 has closed? > > AddHandler Form2.Closed, Addressof frm_Closed
Form2.ShowDialog() private sub frm_Closed(sender as object , e as EventArgs) // Write code here to do things when Form2 is closed... end sub Show quoteHide quote "Aziz" <aziz***@googlemail.com> wrote in message news:1144167181.474040.222650@t31g2000cwb.googlegroups.com... > My fault for not being more clear. > > Basically what I want to know is if I Open Form2 from Form1 using > ShowDialog, how can Form1 know when Form2 has closed? >
To use a combo ornot
Error: Login failed for user ???? How to retrive Outlook 2003 style gradient color schemes? Dataset Problem Copy List(Of type) to another List(Of type) Example of encryption Printing the contents of a textbox Base Class Method to use Shadow'ed member variable of Derived Class? Writing an app for both WinForms and Console use rich text maximum number of lines |
|||||||||||||||||||||||