PC Review


Reply
Thread Tools Rate Thread

Detect if MDI is open

 
 
alex
Guest
Posts: n/a
 
      14th Oct 2003
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.MdiParent = Me
myChildForm1.Show()

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

 
Reply With Quote
 
 
 
 
Michael Maes
Guest
Posts: n/a
 
      14th Oct 2003
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(ChildForms.myChildForm1) Then

ChildForms.myChildForm1= New frmForm1

With ChildForms.myChildForm1

.MdiParent = ChildForms.frmMDI.ActiveForm

.Show()

.WindowState = wState

.StartPosition = FormStartPosition.CenterParent

End With

Else

' Child is instanciated so bring it back to top

ChildForms.myChildForm1.Activate()

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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
| 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.MdiParent = Me
| myChildForm1.Show()
|
| 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
|


 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      14th Oct 2003
* alex <(E-Mail Removed)> 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.de/groups?selm=u5iBdcHRDHA.1552%40TK2MSFTNGP10.phx.gbl>

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
detect if a file is open deerchao Microsoft C# .NET 1 17th Sep 2007 10:25 AM
Detect another open .mdb Milo Microsoft Access VBA Modules 2 2nd Feb 2005 12:01 PM
How to detect whether a Form is Open... John F Kappler Microsoft Access 1 20th May 2004 10:56 AM
Re: Detect A File Is Open TC Microsoft Access Form Coding 1 7th Nov 2003 02:59 PM
Re: Detect A File Is Open Dirk Goldgar Microsoft Access Form Coding 1 7th Nov 2003 02:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:43 AM.