473,396 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Form Closing Event

Hi, ther
I met a problem in my application. I have a starup modal winform, say, Form1, and a modal winform Form2. Form2 is displayed when user clicks a button on form1. My problem is I wish to take an action to refresh a control in Form1 right after Form2 is closed.
Can someone give any advice? Any code sample will be appreciated

Thanks a lot

Nov 20 '05 #1
2 1107
Tracy,

If Form 2 is opened modally from Form 1, you can still access it until it is
disposed (the form is just hidden)

In Form2, set your 'OK' button DialogResult property = DialogResult.OK and
in the Form, set the AcceptButton property to the 'OK' button

Then, in Form 1
Dim frm as New Form2
If frm.ShowDialog = DialogResult.OK Then
'Set a property in Form1 (Me) based on a property in Form2 (frm). eg
Me.TextBox1.Text = frm.TextBox1.Text
End If
'Dispose Form2
frm.Dispose

Stephen
"Tracey" <an*******@discussions.microsoft.com> wrote in message
news:F7**********************************@microsof t.com...
Hi, there
I met a problem in my application. I have a starup modal winform, say, Form1, and a modal winform Form2. Form2 is displayed when user clicks a
button on form1. My problem is I wish to take an action to refresh a control
in Form1 right after Form2 is closed. Can someone give any advice? Any code sample will be appreciated !

Thanks a lot!

Nov 20 '05 #2
Thank you so much!
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: RAJ | last post by:
hi plz tell me how to know "how window is going to close"... i have to right code for X button of forms... plz telll me thanks bye
1
by: Chris Bruce | last post by:
In my application I need a way to distiguish between the following events: 1. When a user closes an MDI child window. 2. When the user closes the MDI parent window which subsequently closes the...
1
by: **Developer** | last post by:
When I get a closing event in a MID Child form I don't know if the child form is closing or the main form is closing. Is there a way to tell? Thank
19
by: zacks | last post by:
I have a .NET 2.0 MDI application where the child form has a Tab Control. Each of the Tab in the Tab Control has a Validating event to handle what it should do when the user changes tabs. But...
19
by: zacks | last post by:
I have a .NET 2.0 MDI application where the child form has a Tab Control. Each of the Tab in the Tab Control has a Validating event to handle what it should do when the user changes tabs. But...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.