473,398 Members | 2,812 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,398 software developers and data experts.

Form OnClose()

GVN
Hi,

I have two projects in my solution explorer. Say ProjA, ProjB. In
ProjA I have a form called ProjAForm. In ProjB I have another form
called ProjBForm. Now in ProjAForm, under a button click, I want to
load ProjBForm in modeless fashion. I can load as many forms as I want
in this manner. In ProjAForm OnClosing event I would like to know the
object names of all the modeless forms that are loaded. Is it possible?
Can any one help me in this regard?

Thanks,
GVN.

Sep 9 '06 #1
4 10135
Hello GVN,

store the created Forms in a Singleton that you can access whereever you
want. Here is how to set up a Singleton (threadsafe):

http://www.codegod.de/WebAppCodeGod/Main.aspx?pid=71

Bye,

--
Matthias Pieroth
www.codegod.de - The Page for .NET-developers
Sep 9 '06 #2
GVN
Hello Matthias,

Thank you. It worked. But what is the case if I have ProjectC,
ProjectD, which also has access to ProjectBForm and raises that form?
Will this Singleton functionality help mePlease advise me in this
context.

Thanks,
GVN.

Matthias Pieroth wrote:
Hello GVN,

store the created Forms in a Singleton that you can access whereever you
want. Here is how to set up a Singleton (threadsafe):

http://www.codegod.de/WebAppCodeGod/Main.aspx?pid=71

Bye,

--
Matthias Pieroth
www.codegod.de - The Page for .NET-developers
Sep 9 '06 #3
On 9 Sep 2006 02:22:29 -0700, "GVN" <mu***********@hotmail.comwrote:
>Hi,

I have two projects in my solution explorer. Say ProjA, ProjB. In
ProjA I have a form called ProjAForm. In ProjB I have another form
called ProjBForm. Now in ProjAForm, under a button click, I want to
load ProjBForm in modeless fashion. I can load as many forms as I want
in this manner. In ProjAForm OnClosing event I would like to know the
object names of all the modeless forms that are loaded. Is it possible?
Can any one help me in this regard?

Thanks,
GVN.
Why not keep a list of the open forms by adding a reference to them to a List<T>
object and when the parent form closes, loop through it and close the children?
Each form that was capable of opening another form would keep this list, making
the destruction (closing) of the child forms recursive.
Good luck with your project,

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com
Sep 9 '06 #4
Hi!

Of cause it will help you. The Singleton can beplaced in a separate dll
(Assembly), which is accessible over all of your projects.

Bye,

--
Matthias Pieroth
www.codegod.de - The Page for .NET-developers
Sep 9 '06 #5

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

Similar topics

2
by: clarket | last post by:
Hi, I have a html form where all the details are saved in a MySQL database that uses PHP to insert the data into the database. The problem I'm having is that if people dont submit the form...
9
by: Susan Bricker | last post by:
I am currently using the OnDirty event of a Form to detect whether any fields have been modified. I set a boolean variable. Then, if the Close button is clicked before the Save button, I can put...
2
by: Steve McLellan | last post by:
Hi all, I'm trying to override Form events (for example OnClosing or OnClose) with the intention of preventing the base class function from happening. My functions are getting called but so are...
6
by: Luke Matuszewski | last post by:
As in topic... has anyone used it ? I tried to use it but i guess i failed... here is a code: <html> <head> <title></title> <script type="text/javascript"> function closedWin() {...
15
by: kokostik | last post by:
I did a few searches, but couldn't come up with a clear answer to my question. So here it is: If I am in an open form (MyForm1), is it possible to set the RecordSource of an un-opened form...
2
by: rdemyan via AccessMonster.com | last post by:
I have a custom message form that I want to display when the user shuts down my app. Some clean up needs to be done during shutdown and I want to display this form and then display various...
4
by: Macbane | last post by:
Hi, I have a 'main' form called frmIssues which has a subform control (named linkIssuesDrug) containing the subform sfrmLink_Issues_Drugs. A control button on the main form opens a pop-up form...
2
by: Tom_F | last post by:
To comp.databases.ms-access -- I would like to trigger an event when I close a form -- but ONLY when the data in the "RecordSource" table has been updated. I tried using the AfterUpdate event,...
0
by: kundanu | last post by:
Hi , i'm using following code to submit a page function onClose() { alert("Closing . . . "); var myHiddenField =...
10
by: kpfunf | last post by:
I have an OnClose function that opens a switchboard (SwitchOpen). This function is placed in numerous objects' (reports and forms) OnClose event, and works great. However, a very annoying...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.