Hi VB.Net Gurus.
Initial MDI Child form loads fine.
exp.
Dim objChild2 As New Form2()
objChild2.MdiParent = Me
objChild2.Show()
MDI Child unloads just fine.
Exp.
If e.Button Is tbbExit Then
'' Me.Close()
Me.Hide()
rs.Close()
cn.Close()
End If
The MDI Child reload does not reload into the parent form.
It reloads outside the parent form.
exp.
Dim oForm As New Form2()
oForm.MdiParent = Me.ActiveMdiChild
oForm.Show()
Regards,
Tony
Why not use this again?
Dim oForm As New Form2()
oForm.MdiParent = Me.ActiveMdiChild
oForm.Show()
Because loaded by another form's label link yields this;
Additional information: The form that was specified
to be the MdiParent for this form is not an MdiContainer.
Tony
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it! 17 4143
Int he first part which works you have
objChild2.MdiParent = Me
In the second part, which doesn't work, you have
oForm.MdiParent = Me.ActiveMdiChild
Why would you be trying to set the MdiParent to Me.ActiveMdiChild?
Bob
"Tony Diggs" <to**@idmd.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi VB.Net Gurus.
Initial MDI Child form loads fine. exp.
Dim objChild2 As New Form2() objChild2.MdiParent = Me objChild2.Show()
MDI Child unloads just fine. Exp. If e.Button Is tbbExit Then '' Me.Close() Me.Hide()
rs.Close() cn.Close()
End If
The MDI Child reload does not reload into the parent form. It reloads outside the parent form. exp.
Dim oForm As New Form2() oForm.MdiParent = Me.ActiveMdiChild oForm.Show()
Regards,
Tony
Why not use this again? Dim oForm As New Form2() oForm.MdiParent = Me.ActiveMdiChild oForm.Show()
Because loaded by another form's label link yields this;
Additional information: The form that was specified to be the MdiParent for this form is not an MdiContainer.
Tony
*** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
Tony
Go to the proerties of the form in question and look
for 'isMDIContainer' set this property as true then use
the code:
\\\
Dim oForm As New Form2()
oForm.MdiParent = Me.ActiveMdiChild
oForm.Show()
///
to call another instance of the child from anywhere in
the form that you just made a MDI container
Now, the first instance won't load.
Err. message;
Additional information: A form can't be both an MDI child and MDI
parent.
Also, any subsequent forms that I want to load from the menu form,
load successfully, but do not load into the parent form next to the
menu form. It loads outside the parent form. I'm trying to get all forms
to load into the parent form as in VB 6.0
Tony
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
VB.Net User
Answer from Microsoft:
Dim oForm As New Form2()
oForm.MdiParent = Me.ParentForm
oForm.Show()
Tony
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
This is how I am handling MDI child forms that should only have a single
instance.
Private Sub MenuItemCustomerMaintenance_Click(ByVal sender As System.Object,
_
ByVal e As System.EventArgs) _
Handles MenuItemCustomerMaintenance.Click
Static afrm As FormCustomerMaintenance
If afrm Is Nothing OrElse afrm.IsDisposed Then
afrm = New FormCustomerMaintenance
afrm.MdiParent = Me
End If
afrm.Show()
afrm.BringToFront()
End Sub
"tonyd" < to********@aol.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
VB.Net User Answer from Microsoft: Dim oForm As New Form2() oForm.MdiParent = Me.ParentForm oForm.Show()
Tony
*** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
"If afrm Is Nothing OrElse afrm.IsDisposed Then"
Here's a problem. Don't use OrElse. Use Or.
Bob
"Jim Hughes" <NO*********@HotMail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl... This is how I am handling MDI child forms that should only have a single instance.
Private Sub MenuItemCustomerMaintenance_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MenuItemCustomerMaintenance.Click
Static afrm As FormCustomerMaintenance
If afrm Is Nothing OrElse afrm.IsDisposed Then
afrm = New FormCustomerMaintenance
afrm.MdiParent = Me
End If
afrm.Show()
afrm.BringToFront()
End Sub
"tonyd" <
to********@aol.com> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl...
VB.Net User Answer from Microsoft: Dim oForm As New Form2() oForm.MdiParent = Me.ParentForm oForm.Show()
Tony
*** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
I'm new to .Net, but a longtime VB6 programmer, I had tried that at first,
it didn't work.
Bob, can you please explain why it is a problem?
"Bob" <no*****@nospam.net> wrote in message
news:el*************@tk2msftngp13.phx.gbl... "If afrm Is Nothing OrElse afrm.IsDisposed Then"
Here's a problem. Don't use OrElse. Use Or.
Bob
"Jim Hughes" <NO*********@HotMail.com> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl... This is how I am handling MDI child forms that should only have a single instance.
Private Sub MenuItemCustomerMaintenance_Click(ByVal sender As
System.Object, _
ByVal e As System.EventArgs) _
Handles MenuItemCustomerMaintenance.Click
Static afrm As FormCustomerMaintenance
If afrm Is Nothing OrElse afrm.IsDisposed Then
afrm = New FormCustomerMaintenance
afrm.MdiParent = Me
End If
afrm.Show()
afrm.BringToFront()
End Sub
"tonyd" <
to********@aol.com> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl...
VB.Net User Answer from Microsoft: Dim oForm As New Form2() oForm.MdiParent = Me.ParentForm oForm.Show()
Tony
*** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
> > Here's a problem. Don't use OrElse. Use Or.
Whoops never mind about that, I misread the code.
Er, your code looks fine. Here is a simple working example of what I think
you're after, though I'm not sure you need it. If it doesn't help, you should
post code that reproduces the problem you're having.
Bob
Module Main
Public Sub Main()
Dim ParentForm As New MDIParentForm
ParentForm.WindowState = FormWindowState.Maximized
ParentForm.ShowDialog()
End Sub
Public Class MDIParentForm
Inherits Form
Public Sub New()
Me.IsMdiContainer = True
Me.Menu = New MainMenu
Me.Menu.MenuItems.Add("show child form", _
AddressOf mnuShowChildClicked)
End Sub
Private Sub mnuShowChildClicked( _
ByVal sender As Object, ByVal e As EventArgs)
Static ChildForm As Form
If ChildForm Is Nothing OrElse ChildForm.IsDisposed Then
ChildForm = New Form
ChildForm.MdiParent = Me
End If
ChildForm.Show()
ChildForm.BringToFront()
End Sub
End Class
End Module
"Jim Hughes" <NO*********@HotMail.com> wrote in message
news:%2******************@TK2MSFTNGP12.phx.gbl... I'm new to .Net, but a longtime VB6 programmer, I had tried that at first, it didn't work.
Bob, can you please explain why it is a problem?
"Bob" <no*****@nospam.net> wrote in message news:el*************@tk2msftngp13.phx.gbl... "If afrm Is Nothing OrElse afrm.IsDisposed Then"
Here's a problem. Don't use OrElse. Use Or.
Bob
"Jim Hughes" <NO*********@HotMail.com> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl... This is how I am handling MDI child forms that should only have a single instance.
Private Sub MenuItemCustomerMaintenance_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MenuItemCustomerMaintenance.Click
Static afrm As FormCustomerMaintenance
If afrm Is Nothing OrElse afrm.IsDisposed Then
afrm = New FormCustomerMaintenance
afrm.MdiParent = Me
End If
afrm.Show()
afrm.BringToFront()
End Sub
"tonyd" <
to********@aol.com> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl...
> > > VB.Net User > Answer from Microsoft: > Dim oForm As New Form2() > oForm.MdiParent = Me.ParentForm > oForm.Show() > > Tony > > > *** Sent via Developersdex http://www.developersdex.com *** > Don't just participate in USENET...get rewarded for it!
Bob, "If afrm Is Nothing OrElse afrm.IsDisposed Then" Here's a problem. Don't use OrElse. Use Or.
Use "Or" if you want to ensure a NullReferenceException! :-|
Remember that "OrElse" is short circuited where as "Or" is not. Which means
that if afrm is Nothing, OrElse will not attempt to call afrm.IsDisposed,
avoiding the NullReferenceException.
However!! Or will attempt to call afrm.IsDisposed whether afrm is Nothing or
not.
Hope this helps
Jay
"Bob" <no*****@nospam.net> wrote in message
news:el*************@tk2msftngp13.phx.gbl... "If afrm Is Nothing OrElse afrm.IsDisposed Then"
Here's a problem. Don't use OrElse. Use Or.
Bob
"Jim Hughes" <NO*********@HotMail.com> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl... This is how I am handling MDI child forms that should only have a single instance.
Private Sub MenuItemCustomerMaintenance_Click(ByVal sender As
System.Object, _
ByVal e As System.EventArgs) _
Handles MenuItemCustomerMaintenance.Click
Static afrm As FormCustomerMaintenance
If afrm Is Nothing OrElse afrm.IsDisposed Then
afrm = New FormCustomerMaintenance
afrm.MdiParent = Me
End If
afrm.Show()
afrm.BringToFront()
End Sub
"tonyd" <
to********@aol.com> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl...
VB.Net User Answer from Microsoft: Dim oForm As New Form2() oForm.MdiParent = Me.ParentForm oForm.Show()
Tony
*** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
Jim,
I would expect your method to work.
Are you having a problem with your method or did you offer it as a solution
to the OP?
Bob's advice is not very sound, as it will ensure a NullReferenceException
when afrm is Nothing, where as your sample will correctly avoid the
NullReferenceException via the OrElse operator.
I don't see any problems with your sample, which is why I am asking if you
had a problem with it.
Hope this helps
Jay
"Jim Hughes" <NO*********@HotMail.com> wrote in message
news:%2******************@TK2MSFTNGP12.phx.gbl... I'm new to .Net, but a longtime VB6 programmer, I had tried that at first, it didn't work.
Bob, can you please explain why it is a problem?
"Bob" <no*****@nospam.net> wrote in message news:el*************@tk2msftngp13.phx.gbl... "If afrm Is Nothing OrElse afrm.IsDisposed Then"
Here's a problem. Don't use OrElse. Use Or.
Bob
"Jim Hughes" <NO*********@HotMail.com> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl... This is how I am handling MDI child forms that should only have a
single instance.
Private Sub MenuItemCustomerMaintenance_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MenuItemCustomerMaintenance.Click
Static afrm As FormCustomerMaintenance
If afrm Is Nothing OrElse afrm.IsDisposed Then
afrm = New FormCustomerMaintenance
afrm.MdiParent = Me
End If
afrm.Show()
afrm.BringToFront()
End Sub
"tonyd" <
to********@aol.com> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl...
> > > VB.Net User > Answer from Microsoft: > Dim oForm As New Form2() > oForm.MdiParent = Me.ParentForm > oForm.Show() > > Tony > > > *** Sent via Developersdex http://www.developersdex.com *** > Don't just participate in USENET...get rewarded for it!
Thank you, yes, everybody, I MADE A MISTAKE. Read my later post. See it? Posted
before this one? I'M SORRY. Sheesh. >:(
Bob
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl... Jim, I would expect your method to work.
Are you having a problem with your method or did you offer it as a solution to the OP?
Bob's advice is not very sound, as it will ensure a NullReferenceException when afrm is Nothing, where as your sample will correctly avoid the NullReferenceException via the OrElse operator.
I don't see any problems with your sample, which is why I am asking if you had a problem with it.
Hope this helps Jay
"Jim Hughes" <NO*********@HotMail.com> wrote in message news:%2******************@TK2MSFTNGP12.phx.gbl... I'm new to .Net, but a longtime VB6 programmer, I had tried that at first, it didn't work.
Bob, can you please explain why it is a problem?
"Bob" <no*****@nospam.net> wrote in message news:el*************@tk2msftngp13.phx.gbl... "If afrm Is Nothing OrElse afrm.IsDisposed Then"
Here's a problem. Don't use OrElse. Use Or.
Bob
"Jim Hughes" <NO*********@HotMail.com> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl... > This is how I am handling MDI child forms that should only have a single > instance. > > Private Sub MenuItemCustomerMaintenance_Click(ByVal sender As System.Object, > _ > > ByVal e As System.EventArgs) _ > > Handles MenuItemCustomerMaintenance.Click > > Static afrm As FormCustomerMaintenance > > If afrm Is Nothing OrElse afrm.IsDisposed Then > > afrm = New FormCustomerMaintenance > > afrm.MdiParent = Me > > End If > > afrm.Show() > > afrm.BringToFront() > > End Sub > > "tonyd" < > > to********@aol.com> wrote in message > news:%2****************@TK2MSFTNGP12.phx.gbl... > > > > > > > VB.Net User > > Answer from Microsoft: > > Dim oForm As New Form2() > > oForm.MdiParent = Me.ParentForm > > oForm.Show() > > > > Tony > > > > > > *** Sent via Developersdex http://www.developersdex.com *** > > Don't just participate in USENET...get rewarded for it! > >
* "Bob" <no*****@nospam.net> scripsit: "If afrm Is Nothing OrElse afrm.IsDisposed Then"
Here's a problem. Don't use OrElse. Use Or.
Why?
Are you sure about the difference between 'Or' and 'OrElse'?
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Hi Herfried,
I know a Hamster has little eyes, but Bob did make an excuus about his
misreading at our time 17:13 and 17:47 so this is a little bit much mustard
after dinner.
:-)))
Cor
Come on!
Oh, I get it. You're goading me now. Fine. Tweak my nose. Go ahead. I can take
it.
:P
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bq*************@ID-208219.news.uni-berlin.de... * "Bob" <no*****@nospam.net> scripsit: "If afrm Is Nothing OrElse afrm.IsDisposed Then"
Here's a problem. Don't use OrElse. Use Or.
Why?
Are you sure about the difference between 'Or' and 'OrElse'?
-- Herfried K. Wagner [MVP] <http://www.mvps.org/dotnet>
* "Cor" <no*@non.com> scripsit: I know a Hamster has little eyes, but Bob did make an excuus about his misreading at our time 17:13 and 17:47 so this is a little bit much mustard after dinner.
OE shows the complete thread, my other newsreader doesn't.
:-(((
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Jay, sorry for the late reply, been busy recovering from the Thanksgiving
day holiday.
I was offering it as a solution, I had no problem with it. I just didn't
understand the Or/OrElse issue that Bob raised.
I see that others responded appropriately :)
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl... Jim, I would expect your method to work.
Are you having a problem with your method or did you offer it as a
solution to the OP?
Bob's advice is not very sound, as it will ensure a NullReferenceException when afrm is Nothing, where as your sample will correctly avoid the NullReferenceException via the OrElse operator.
I don't see any problems with your sample, which is why I am asking if you had a problem with it.
Hope this helps Jay
"Jim Hughes" <NO*********@HotMail.com> wrote in message news:%2******************@TK2MSFTNGP12.phx.gbl... I'm new to .Net, but a longtime VB6 programmer, I had tried that at
first, it didn't work.
Bob, can you please explain why it is a problem?
"Bob" <no*****@nospam.net> wrote in message news:el*************@tk2msftngp13.phx.gbl... "If afrm Is Nothing OrElse afrm.IsDisposed Then"
Here's a problem. Don't use OrElse. Use Or.
Bob
"Jim Hughes" <NO*********@HotMail.com> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl... > This is how I am handling MDI child forms that should only have a single > instance. > > Private Sub MenuItemCustomerMaintenance_Click(ByVal sender As
System.Object, > _ > > ByVal e As System.EventArgs) _ > > Handles MenuItemCustomerMaintenance.Click > > Static afrm As FormCustomerMaintenance > > If afrm Is Nothing OrElse afrm.IsDisposed Then > > afrm = New FormCustomerMaintenance > > afrm.MdiParent = Me > > End If > > afrm.Show() > > afrm.BringToFront() > > End Sub > > "tonyd" < > > to********@aol.com> wrote in message > news:%2****************@TK2MSFTNGP12.phx.gbl... > > > > > > > VB.Net User > > Answer from Microsoft: > > Dim oForm As New Form2() > > oForm.MdiParent = Me.ParentForm > > oForm.Show() > > > > Tony > > > > > > *** Sent via Developersdex http://www.developersdex.com *** > > Don't just participate in USENET...get rewarded for it! > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Emmanuel |
last post by:
Hi,
I use a 'reload all' feature in my app, that allow to reload every
module.
I first try this version :
import sys
def Reload():
|
by: Marshall Dudley |
last post by:
I need to be able to allow a user to submit a form which opens another
window. This part I have working. But after the submit, I need to delay
and have the original window do a reload. I cannot...
|
by: Raj |
last post by:
Hi All,
I have a problem with trying to refresh the parent window from
child window in order to update data in the parent window.
The sequence of events are
1) I click a button in the parent...
|
by: Tony |
last post by:
Hi VB.Net Gurus.
Initial MDI Child form loads fine.
exp.
Dim objChild2 As New Form2()
objChild2.MdiParent = Me
objChild2.Show()
MDI Child unloads just fine.
Exp.
|
by: =?Utf-8?B?UGF1bA==?= |
last post by:
Hi I tried a google search but could not find anything. I am trying to cause
one webpage to reload when a second web page is closed. The second webpage
loads data into a session variable and when...
| |
by: Buddha |
last post by:
Hello,
I posted this on two forums, without too much help .. and I am kinda
stuck in this.
I need to refresh the parent page from the second child window which
is opened by the first child and...
|
by: Rafe |
last post by:
Hi,
This seems to be an old question, and I've read back a bit, but rather
than assume the answer is "you can't do that", I'd thought I'd post my
version of the question along with a...
|
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,...
|
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,...
|
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...
|
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...
| |
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...
|
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,...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |