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

vb.net modal form

I have a form with information on it, when a button is clicked, another form
is opened with the following code:
Dim myForm As New ReqVendorSelect
myForm.Visible = True

Once i'm done manipulating some data on the 2nd form, the 2nd form is closed
and the original form is now visible. Is there anyway for the original form
to know when the newly created form is closed?

Chris Thunell
ct******@pierceassociates.com
Nov 20 '05 #1
6 9961
"Chris Thunell" <ct******@pierceassociates.com> schrieb
I have a form with information on it, when a button is clicked,
another form is opened with the following code:
Dim myForm As New ReqVendorSelect
myForm.Visible = True

Once i'm done manipulating some data on the 2nd form, the 2nd form is
closed and the original form is now visible. Is there anyway for the
original form to know when the newly created form is closed?


Is there a reason why you don't show the form modally? (as mentioned in the
subject line)

Dim myForm As New ReqVendorSelect
myForm.ShowDialog
--
Armin

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

Nov 20 '05 #2
* "Chris Thunell" <ct******@pierceassociates.com> scripsit:
I have a form with information on it, when a button is clicked, another form
is opened with the following code:
Dim myForm As New ReqVendorSelect
myForm.Visible = True

Once i'm done manipulating some data on the 2nd form, the 2nd form is closed
and the original form is now visible. Is there anyway for the original form
to know when the newly created form is closed?


\\\
Dim MyForm As New ...
MyForm.ShowDialog(Me)
..
..
..
///

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

<http://www.plig.net/nnq/nquote.html>
Nov 20 '05 #3
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> schrieb

Dim MyForm As New ...
MyForm.ShowDialog(Me)


Why is "Me" always used? I only use it with modeless Forms, and never with
modal Forms. I know the argument name, but I don't see a difference to
specifying no argument with modal Forms.
--
Armin

Nov 20 '05 #4
* "Armin Zingler" <az*******@freenet.de> scripsit:
Dim MyForm As New ...
MyForm.ShowDialog(Me)


Why is "Me" always used? I only use it with modeless Forms, and never with
modal Forms. I know the argument name, but I don't see a difference to
specifying no argument with modal Forms.


'Me' isn't necessary, you are right...

;-)

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

<http://www.plig.net/nnq/nquote.html>
Nov 20 '05 #5
Hi Chiris,

My colleague has replied to you in microsoft.public.dotnet.general group.

================================================== =================
Newsgroups: microsoft.public.dotnet.general
From: ti******@online.microsoft.com (Tian Min Huang)
Date: Tue, 11 Nov 2003 03:41:29 GMT
Subject: RE: vb.net modal form

Hi Chris,

Thanks for your post. I agree with Armin and strongly recommend you use
ShowDialog to display the form modally. In addition, the original form is
able to be notified when the newly created form is closed in the Closed
event handler of the new form. Please refer to the following code snippet:

'------------------------code snippet---------------------------
Public Class Form1
Inherits System.Windows.Forms.Form

Dim WithEvents myForm As New ReqVendorSelect

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
myForm.Visible = True
End Sub

Private Sub myForm_Closed(ByVal sender As Object, ByVal e As
System.EventArgs) Handles myForm.Closed
MsgBox("myForm closed")
End Sub
End Class
'--------------------------end of------------------------------------

Hope this helps.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
================================================== ================
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 20 '05 #6
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> schrieb
* "Armin Zingler" <az*******@freenet.de> scripsit:
Dim MyForm As New ...
MyForm.ShowDialog(Me)


Why is "Me" always used? I only use it with modeless Forms, and
never with modal Forms. I know the argument name, but I don't see a
difference to specifying no argument with modal Forms.


'Me' isn't necessary, you are right...

;-)


I read the docs now, but it doesn't tell me anything new: "...is the owner
of the modal Form...". Yeah, I know this already, but what does it cause? I
know that specifying the owner form for a modeless form makes the form
minimize/restore automatically whenever the owner is minimized/restored, and
it also show the owned form always on top of the owner form, but a modal
form is also always on top of the owning form, so I don't see a reason for
this argument. Only a thought.
--
Armin

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

Nov 20 '05 #7

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

Similar topics

2
by: martin de vroom | last post by:
Hi, I have a web page that opens a modal dialog (client side) in the following manner onclick="window.showModalDialog('/dialog.asp',null,'dialogHeight: 200px; dialogWidth: 400px; dialogTop:...
2
by: Matt | last post by:
I want to know how to submit the form data to a modal dialog window? The following is page1.asp, and when the user clicks submit button, it will post the form data to page2.asp by opening a new...
4
by: Kyralessa | last post by:
In Access 2000, I have a base form with a ListBox of conference registrants. In the form's declarations section I include Dim f as Form To add a registrant I'm doing this: Set f = New...
4
by: Paul Aspinall | last post by:
Can anyone advise how to display a form on top, and modal, without using ShowDialog?? Thanks
23
by: Chukkalove | last post by:
Im sorry, I dont know the correct description for a hierarchy of parent and child forms. I have a main form that opens a child form modally. This child form in turn opens it's own child form...
2
by: Mike | last post by:
Hi, I'm having a problem with modal forms on windows. I've written a very short test program, with a main window and a form called from the main window. The form is set to modal with...
1
by: samentu | last post by:
Hi there. I'm having a little problem here with some forms. Let me describe the problem: my application has a MDI parent form (the form that starts with the application); then when I click a button...
2
by: diogenes | last post by:
I have created many shortcut/popup (aka context, or right-click) menus for my application - instead of toolbars or standard drop-down menus. Within my custom menu, I am using...
4
by: =?Utf-8?B?Z2luYWNyZXNzZQ==?= | last post by:
I am trying to close/dispose multiple instances of a form but because they are modal and hidden, they do not show up in My.Application.OpenForms. They must be modal, so making them modeless is not...
1
by: Mohit | last post by:
Hi all, I am working on a windows based client server application with multiple forms. All forms are having custom title bars with no default bars. There is one main form. Some forms are opened up...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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
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,...

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.