473,797 Members | 2,926 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Detect if MDI is open

Hi,
how can I detect if an MDI is already open or not in order to prevent it
from being opened again.

How can I bring the MDI form to the TOP from the parent window.
If I do a
Dim myChildForm1 As New frmForm1()
myChildForm1.Md iParent = Me
myChildForm1.Sh ow()

to startup the form in a Sub of the parent then i supposed I need to
store the reference somehow in order to access it later from a different
or even the same sub.

Can anyone give me a hand on that ?

Thanks

A

Nov 20 '05 #1
2 1310
Hi A,

I gues you want to check if a 'Child' is open. (an MDI is the container-form
(parent))
I think the best practice is to create an accessible variable.
Look at the folowing code (you can put this in a genaral module)

If IsNothing(Child Forms.myChildFo rm1) Then

ChildForms.myCh ildForm1= New frmForm1

With ChildForms.myCh ildForm1

.MdiParent = ChildForms.frmM DI.ActiveForm

.Show()

.WindowState = wState

.StartPosition = FormStartPositi on.CenterParent

End With

Else

' Child is instanciated so bring it back to top

ChildForms.myCh ildForm1.Activa te()

End If

'Childforms' in this case is a "Shared Class". You can do the trick also
with 'plain' variables.
I use these classes because of readability and ease of use (eg:
intellisense)

HTH,

Michael
"alex" <ai******@hotma il.com> wrote in message
news:eq******** ******@TK2MSFTN GP12.phx.gbl...
| Hi,
| how can I detect if an MDI is already open or not in order to prevent it
| from being opened again.
|
| How can I bring the MDI form to the TOP from the parent window.
|
|
| If I do a
| Dim myChildForm1 As New frmForm1()
| myChildForm1.Md iParent = Me
| myChildForm1.Sh ow()
|
| to startup the form in a Sub of the parent then i supposed I need to
| store the reference somehow in order to access it later from a different
| or even the same sub.
|
| Can anyone give me a hand on that ?
|
| Thanks
|
| A
|
Nov 20 '05 #2
* alex <ai******@hotma il.com> scripsit:
how can I detect if an MDI is already open or not in order to prevent
it from being opened again.


<http://groups.google.d e/groups?selm=u5i BdcHRDHA.1552%4 0TK2MSFTNGP10.p hx.gbl>

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #3

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

Similar topics

4
3732
by: Doug R | last post by:
Hello, I could use a little help from you Gurus out there. I have an aplication that watches a directory and detects when a PGP encrypted file lands in the directory and starts a process that decrypts it and parses the resulting contents. I am using the FileSystemWatcher's Created event to detect when the file arrives. The problem I have is that these files are large(5-10 megs) and they are being transfered over a limited pipe. I...
5
8486
by: Quinn | last post by:
When users clicked a unkown mime type link such as Zip on my website, a "Save/Open/Cancel" dialog box pops up. Is there a way to detect which button users clicked by using ASP? actually I only what to record the "valid" click -- when Open/Save was clicked. Thanks ahead. Quinn
23
6532
by: David McCulloch | last post by:
QUESTION-1: How can I detect if Norton Internet Security is blocking pop-ups? QUESTION-2a: How could I know if a particular JavaScript function has been declared? QUESTION-2b: How could I know if Window.Open has been redefined? BACKGROUND:
6
5243
by: hb | last post by:
Hi, Would you please tell me how to detect if the client's browser is closed? I need such event to trigger a database modification. Thank you hb
4
2765
by: Marc Scheuner | last post by:
Folks, I have a text file which contains some XML. In its XML header, it claims to be of UTF-8 encoding - however, it's really not, it's a ANSI / Windows-1252 / ISO-8859-1 encoding. Trouble is: when I deserialize objects from that file, all the German umlauts and other special characters get dropped, some even cause deserialization errors.
1
2269
by: mjobbe | last post by:
Hi, I'm creating an MSI for a client app using a Visual Studio Setup Project. I'm trying to detect if Internet Explorer is running on the target computer before I start the installation. How do I go about detecting this? Thanks.
2
10121
by: bobh | last post by:
Hi All, In AccessXP on the main menu screen I give the user the option to open this form in either Edit or Read-Only mode. When the user chooses read-only which I use the following line DoCmd.OpenForm "frmLookupAgencyContactInfo", , , , acFormReadOnly, , strSQL
1
3695
by: Andy Bates | last post by:
Hi - Can't see another newsgroup to post this in; so thought I'd post here. I have a C# application that relies on multicast UDP to detect how many PCs the application is executing on concurrently. This works okay providing the port is open but fails miserably if the port is blocked by a firewall. All applications provide a server listening on the port for the ping but for some reason on the PC sending the ping irrespective of...
36
5410
by: Don | last post by:
I wrote an app that alerts a user who attempts to open a file that the file is currently in use. It works fine except when the file is opened by Notepad. If a text file is opened, most computers are configured to use Notepad to open the file by default and if they are configured to use Notepad by default I want it to remain that way rather than retrieve the text into my app or force the user to use another app to read the file. I'm...
4
7184
by: goscottie | last post by:
I used submodal as my popup window. With some tweaks, it working great in my app. However, I can't find a way to detect session timeout in the popup window. The app is a form based authentication so the default.aspx page will show up in the popup. So I'm looking into several options. 1. detect session timeout in javascript so that I prevent the popup from even happening. I can simply redirect or post to itself so that the calling...
0
9685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10468
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10021
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9063
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5458
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4131
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2933
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.