473,498 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Detect Subforms


I have a main form that can launch several subforms.

Both the main form remains active when the subform is visible.

I want to prevent the user from launching multiple copies of the subform.

How can I do this?

Here's my code for launching one of the subforms:
frmMove Move = new frmMove(this,
treeView1.SelectedNode);

Move.Show();
Move.Activate();
Move.TopMost=true;

Aug 16 '05 #1
2 1408
"John Bailo" <ja*****@texeme.com> wrote in message
news:_t*****************************************@s peakeasy.net...

I have a main form that can launch several subforms.

Both the main form remains active when the subform is visible.

I want to prevent the user from launching multiple copies of the subform.


The subform should then be a field in the parent form. The paremt form
should only create a new subform when there isn't already one in existence.

--
Regards,

Tim Haughton

Agitek
http://agitek.co.uk
http://blogitek.com/timhaughton
Aug 17 '05 #2
Tim Haughton wrote:
The subform should then be a field in the parent form. The paremt form
should only create a new subform when there isn't already one in existence.


Well, I'm probably doing it totally wrong, but here's what I ended up doing.

When I launch, I create a member refernce in the parent (this is not MDI):

if(Child==null)
frmChild Child = new frmChild(frmParent);
So, at that point frmParent.Child holds the reference to the child, and
I pass in a reference to the parent in the constructor.

Then in the child Dispose() method I put

frmParent.Child=null;

So, if the child form is open, it will not launch a new form...it will
only activate and bring the existing one to the foreground.
Aug 17 '05 #3

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

Similar topics

1
7441
by: JJMM | last post by:
Hi, I have a form (form1) with a large number of subforms inside it (around 20 subforms), There is the possibility of filtering the data using a pop-up form that create/change a query (all the...
3
3991
by: Evil | last post by:
Hi, i have a problem with a treeview and some subforms in MS Access97. I have a form with a treeview on the left side which lets me navigate thru some projects. Then on the right side, i have...
1
2971
by: M Wells | last post by:
Hi All, I am developing an Access 2003 project application with the back end in SQL Server 2003. I have a master form that tracks projects, and several subforms on it that track various...
2
2983
by: Jack | last post by:
Hi all, I searched the archives and found everyone happy with Stephen's MouseWheel On/Off code except for those with subforms. Stephen's page indicates that he has added code to handle subforms...
0
2224
by: Jack | last post by:
Gday everyone, I'm dearly hoping Stephen Lebans is going to update his masterpeice to stop the mouse wheel scrolling to work on subforms *he has indicated this to me but of course beggers can't...
4
2946
by: vulcaned | last post by:
Hi All, Hopefully I explain this well........ In Access97 I have a form which has a tab control on it, each tab has a sub-form which is bound to its appropriate table(I'll call them 'Detail'...
5
2618
by: Richard Stanton | last post by:
Hello all My database has a main form linked to table1. It has several subforms on the main form, all linked to table2. Table1 and Table2 are linked by primary/foreign key, no duplicates...
2
225
by: John Bailo | last post by:
I have a main form that can launch several subforms. Both the main form remains active when the subform is visible. I want to prevent the user from launching multiple copies of the subform. ...
4
6016
by: Harlequin | last post by:
I have a question concerning the need to trigger events within a "child" subform which is itself enbedded within a master "parent" form and which is accessible via a tab in the parent form. Becuase...
0
7125
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
7205
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...
1
6887
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
5462
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,...
1
4910
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...
0
4590
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.