473,406 Members | 2,345 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,406 software developers and data experts.

Jumping to another routine

When I exit my app a confirmation message box pops up. If the user chooses
"No", what is the code I need to jump to another sub routine (So the save
file message box pops up). I already have all of the message box routine.

Thank you,
John
Nov 20 '05 #1
5 1036
* "John E. Crouse" <jo*********@comcast.net> scripsit:
When I exit my app a confirmation message box pops up. If the user chooses
"No", what is the code I need to jump to another sub routine (So the save
file message box pops up). I already have all of the message box routine.


The name of the save routine?

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2
in addition , you might want to type "Exit Sub" after calling the Other sub.

/Lars Netzel

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> skrev i meddelandet
news:2i************@uni-berlin.de...
* "John E. Crouse" <jo*********@comcast.net> scripsit:
When I exit my app a confirmation message box pops up. If the user chooses "No", what is the code I need to jump to another sub routine (So the save file message box pops up). I already have all of the message box
routine.
The name of the save routine?

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

Nov 20 '05 #3
* "Lars Netzel" <[stop_spam]@host.topdomain> scripsit:
in addition , you might want to type "Exit Sub" after calling the Other sub.


Or 'Exit Function', if it's a function. Or 'Return' :-).

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #4
Here is the place I am leaving:

Private Sub Form1_Closed(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Closed

Dim response As MsgBoxResult

response = MsgBox("Do you want quit without saving?",
MsgBoxStyle.YesNo, "CPviewer")

If response = MsgBoxResult.Yes Then

Application.Exit()

Else

'mnuSaveLayout_Click()

End If

End Sub
And here is where I want to go:

Private Sub mnuSaveLayout_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles mnuSaveLayout.Click

SaveFileDialog1.Filter = "XML Document|*.xml"

SaveFileDialog1.Title = "Save a Layout File"

SaveFileDialog1.ShowDialog()

If SaveFileDialog1.FileName <> "" Then

Dim ds As New DataSet("CPViewer")

Dim dt1 As New DataTable("P1JoyUp")

End Sub
Thanks,
John

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:2i************@uni-berlin.de...
* "John E. Crouse" <jo*********@comcast.net> scripsit:
When I exit my app a confirmation message box pops up. If the user chooses "No", what is the code I need to jump to another sub routine (So the save file message box pops up). I already have all of the message box
routine.
The name of the save routine?

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

Nov 20 '05 #5
"John E. Crouse" <jo*********@comcast.net> schrieb
Here is the place I am leaving:

Private Sub Form1_Closed(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Closed
It's common usage to put the code in the Closing event and offer "yes, no,
cancel" to the user. If cancel is pressed, set e.cancel = true.
Dim response As MsgBoxResult

response = MsgBox("Do you want quit without saving?",
MsgBoxStyle.YesNo, "CPviewer")

If response = MsgBoxResult.Yes Then

Application.Exit()

Why call application.exit? It's not necessary. Only if you do not have one
specific startup form, call application.exitthread.

Else
Save
End If

End Sub
And here is where I want to go:

Private Sub mnuSaveLayout_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles mnuSaveLayout.Click
Save
End Sub


private sub Save
SaveFileDialog1.Filter = "XML Document|*.xml"

SaveFileDialog1.Title = "Save a Layout File"

SaveFileDialog1.ShowDialog()

If SaveFileDialog1.FileName <> "" Then

Dim ds As New DataSet("CPViewer")

Dim dt1 As New DataTable("P1JoyUp")
end sub
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #6

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

Similar topics

3
by: jalkadir | last post by:
By jump I mean ending unexpectedly. The program below, like the jumping beens, has an unusual behaviour. When the noted lines are not present the program terminates disregarding the rest of the...
3
by: Willis | last post by:
I have a db on one machine, and another on a second machine. I have written some stored procedures that I want to copy to the second machine. As I understand it, there is a possibility to connect...
7
by: Richard Grant | last post by:
Hi. In c/C++ i can pass the address of a subroutine to another subroutine as an actual parameter How do I do that in VB .NET What should be the syntax for a parameter to receive the address of a...
14
by: spamtrap | last post by:
Mostly for testing reasons I'd like to see if it makes sense to chose the following approach for just-in-time compilation of shaders for a renderer: Seeing as the shaders themsefs consist mostly...
5
by: Mike | last post by:
Hi group; Let say I have an object called Account, that raises an event called AccountLow with its owns EventArgs, and when this event gets raised, I will like to raise another custom...
20
by: Prisoner at War | last post by:
Hi, People, Is it possible to have an "empty" or "dummy" <a href***without*** the browser jumping back up the page?? I have a hyperlink that doesn't point to another document, but is used to...
1
by: prathna | last post by:
Hi I have this following code <script> function displayFields() { document.getElementById('Label12').style.display = 'none'; document.getElementById('Label13').style.display =...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
0
jinu1996
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...
0
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...
0
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...
0
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,...

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.