473,385 Members | 1,356 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,385 software developers and data experts.

MDI forms

JFB
Hi All,
I have my MDI form and 10 child forms, I call the child form on the click
event from the menu using
Dim NewChildFrm As New newCustomerForm

NewChildFrm.MdiParent = Me

NewChildFrm.Show()

What can I prevent to open another newCustomerForm from the menu? if is
already one and open just got focus on the form.

Tks in advance

JFB
Nov 20 '05 #1
10 1285
* "JFB" <jf*****@directvinternet.com> scripsit:
I have my MDI form and 10 child forms, I call the child form on the click
event from the menu using
Dim NewChildFrm As New newCustomerForm

NewChildFrm.MdiParent = Me

NewChildFrm.Show()

What can I prevent to open another newCustomerForm from the menu? if is
already one and open just got focus on the form.


\\\
Private myform As Form2

Private Sub Button1_Click( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs _
) Handles Button1.Click
If myform Is Nothing Then
myform = New Form2()
'myform.MdiParent = Me
AddHandler myform.Closed, AddressOf Me.ChildForm_Closed
myform.Show()
Else
'MsgBox("Form already open: " & myform.Text)
Me.ActivateMdiChild(myform) ' Ungetestet: Evtl. funktioniert
' das nicht, da die Methode für die
' interne Infrastruktur dient.
End If
End Sub

Private Sub ChildForm_Closed( _
ByVal sender As Object, _
ByVal e As System.EventArgs _
) Handles MyBase.Closed
myform = Nothing
End Sub
///

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
"JFB" <jf*****@directvinternet.com> schrieb
Hi All,
I have my MDI form and 10 child forms, I call the child form on the
click event from the menu using
Dim NewChildFrm As New newCustomerForm

NewChildFrm.MdiParent = Me

NewChildFrm.Show()

What can I prevent to open another newCustomerForm from the menu? if
is already one and open just got focus on the form.

http://groups.google.com/groups?thre...tngp13.phx.gbl
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #3
JFB
Herfried,
I got an error...
Local variable 'NewChildFrm' cannot be referred to before it is declared.
But I already declare before...
Tks for you help
JFB
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:br*************@ID-208219.news.uni-berlin.de...
* "JFB" <jf*****@directvinternet.com> scripsit:
I have my MDI form and 10 child forms, I call the child form on the click event from the menu using
Dim NewChildFrm As New newCustomerForm

NewChildFrm.MdiParent = Me

NewChildFrm.Show()

What can I prevent to open another newCustomerForm from the menu? if is
already one and open just got focus on the form.


\\\
Private myform As Form2

Private Sub Button1_Click( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs _
) Handles Button1.Click
If myform Is Nothing Then
myform = New Form2()
'myform.MdiParent = Me
AddHandler myform.Closed, AddressOf Me.ChildForm_Closed
myform.Show()
Else
'MsgBox("Form already open: " & myform.Text)
Me.ActivateMdiChild(myform) ' Ungetestet: Evtl. funktioniert
' das nicht, da die Methode für die
' interne Infrastruktur dient.
End If
End Sub

Private Sub ChildForm_Closed( _
ByVal sender As Object, _
ByVal e As System.EventArgs _
) Handles MyBase.Closed
myform = Nothing
End Sub
///

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #4
JFB
I fix this.. the problem now is that the form is created outside the MDI
form and it keeps creating a new one.
Tks
JFB

"JFB" <jf*****@directvinternet.com> wrote in message
news:e9**************@TK2MSFTNGP09.phx.gbl...
Herfried,
I got an error...
Local variable 'NewChildFrm' cannot be referred to before it is declared.
But I already declare before...
Tks for you help
JFB
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:br*************@ID-208219.news.uni-berlin.de...
* "JFB" <jf*****@directvinternet.com> scripsit:
I have my MDI form and 10 child forms, I call the child form on the click event from the menu using
Dim NewChildFrm As New newCustomerForm

NewChildFrm.MdiParent = Me

NewChildFrm.Show()

What can I prevent to open another newCustomerForm from the menu? if is already one and open just got focus on the form.


\\\
Private myform As Form2

Private Sub Button1_Click( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs _
) Handles Button1.Click
If myform Is Nothing Then
myform = New Form2()
'myform.MdiParent = Me
AddHandler myform.Closed, AddressOf Me.ChildForm_Closed
myform.Show()
Else
'MsgBox("Form already open: " & myform.Text)
Me.ActivateMdiChild(myform) ' Ungetestet: Evtl. funktioniert
' das nicht, da die Methode für die
' interne Infrastruktur dient.
End If
End Sub

Private Sub ChildForm_Closed( _
ByVal sender As Object, _
ByVal e As System.EventArgs _
) Handles MyBase.Closed
myform = Nothing
End Sub
///

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>


Nov 20 '05 #5
JFB
Never mine... tks to Armin Zingler I got it...
Tks
JFB

"JFB" <jf*****@directvinternet.com> wrote in message
news:Od**************@TK2MSFTNGP09.phx.gbl...
Hi All,
I have my MDI form and 10 child forms, I call the child form on the click
event from the menu using
Dim NewChildFrm As New newCustomerForm

NewChildFrm.MdiParent = Me

NewChildFrm.Show()

What can I prevent to open another newCustomerForm from the menu? if is
already one and open just got focus on the form.

Tks in advance

JFB

Nov 20 '05 #6
* "JFB" <jf*****@directvinternet.com> scripsit:
I got an error...
Local variable 'NewChildFrm' cannot be referred to before it is declared.


What's 'NewChildForm'?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #7
JFB
Tks for you reply....
I have 10 child froms... can I make this sub's as general so I dont have to
create 20 sub's?
I'm new... Tks
JFB

"Armin Zingler" <az*******@freenet.de> wrote in message
news:ua**************@tk2msftngp13.phx.gbl...
"JFB" <jf*****@directvinternet.com> schrieb
Hi All,
I have my MDI form and 10 child forms, I call the child form on the
click event from the menu using
Dim NewChildFrm As New newCustomerForm

NewChildFrm.MdiParent = Me

NewChildFrm.Show()

What can I prevent to open another newCustomerForm from the menu? if
is already one and open just got focus on the form.

http://groups.google.com/groups?thre...tngp13.phx.gbl

--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #8
"JFB" <jf*****@directvinternet.com> schrieb
Tks for you reply....
I have 10 child froms... can I make this sub's as general so I dont
have to create 20 sub's?
I'm new... Tks
JFB


If you've twenty different types of children, you need either 20 subs or 1
sub and a select case statement.

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

--
Armin

Nov 20 '05 #9
JFB
Cool Armin,
Tks again...
JFB

"Armin Zingler" <az*******@freenet.de> wrote in message
news:uS**************@TK2MSFTNGP12.phx.gbl...
"JFB" <jf*****@directvinternet.com> schrieb
Tks for you reply....
I have 10 child froms... can I make this sub's as general so I dont
have to create 20 sub's?
I'm new... Tks
JFB


If you've twenty different types of children, you need either 20 subs or 1
sub and a select case statement.

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

--
Armin

Nov 20 '05 #10
JFB
Tks for you reply... I fixed with Armin link
JFB

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:br*************@ID-208219.news.uni-berlin.de...
* "JFB" <jf*****@directvinternet.com> scripsit:
I got an error...
Local variable 'NewChildFrm' cannot be referred to before it is
declared.
What's 'NewChildForm'?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #11

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

Similar topics

19
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate...
3
by: Joshua Russell | last post by:
Hi, Both the methods below open up a windows form called MasterForm. However, one works better than the other. Method 1 opens the form correctly but I don't have any reference to the instance of...
7
by: Mike Bulava | last post by:
I have created a base form that I plan to use throughout my application let call the form form1. I have Built the project then add another form that inherits from form1, I add a few panel controls...
13
by: MD | last post by:
I have been converting a program from VB6 to VB.Net and enhancing it as well. All has been progressing OK although its been hard work. Now, all of a sudden, when I try to execute a ShowDialog()...
15
by: Joshua Kendall | last post by:
I have a script in which it keeps opening the same form instead of only one instance. I also need help with a form that has a password. Where do I put the actual password? can I use a database for...
3
by: Lloyd Sheen | last post by:
I have the following situation: Need a user resizable user control. After much trying with user control I came across the idea of hosting the controls in a form marked as not TopLevel = false. ...
8
by: Stephen Rice | last post by:
Hi, I have a periodic problem which I am having a real time trying to sort. Background: An MDI VB app with a DB on SQL 2000. I have wrapped all the DB access into an object which spawns a...
3
by: Geraldine Hobley | last post by:
Hello, In my project I am inheriting several forms. However when I inherit from a form and add additional subroutines and methods to my inherited form I get all sorts of problems. e.g. I sometimes...
6
by: dbuchanan | last post by:
I have a Windows Forms application that accesses SQL Server 2k from a small local network. The application has been used for weeks on other systmes but a new install on a new machine retruns...
21
by: Dan Tallent | last post by:
In my application I have a form (Customer) that I want to be able to open multiple copies at once. Within this form I have other forms that can be opened. Example: ZipCode. When the user enters...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...
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...

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.