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

how to close messageBox?

hi,
i have a module that created a form, and the messageBox is shown in
the closing event , but when the im choosing the "cancel" button in the
messageBox the messageBox and also the form is getting closed
i want the messageBox to close (without the form )?
how to close only the messageBox?
thanks in advanced
Private Sub teacher_Closing(ByVal sender As Object, ByVal e As
System.ComponentModel.CancelEventArgs) Handles MyBase.Closing

Select Case MessageBox.Show("Do you want to save changes?", " ",
MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning,
MessageBoxDefaultButton.Button1)
Case DialogResult.Cancel

Case DialogResult.No
Me.Dispose()
Case DialogResult.Yes
saveAll()
End Select
End Sub

Jul 21 '05 #1
3 2731
Hi s-galit,

In your Cancel case set e.Cancel = true

--
Happy Coding!
Morten Wennevik [C# MVP]
Jul 21 '05 #2
THANKS
you have been very helpul
Jul 21 '05 #3
THANKS
you have been very helpul
Jul 21 '05 #4

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

Similar topics

4
by: PawelR | last post by:
Hello group, In my apps I connection to SQL database. try { //connect to db } catch { MessageBox("Error Connect. Close Apps?","Sql Error",MessageBoxButtons.OKCancel,MessageBoxIcon.Error);
1
by: Ebrahim | last post by:
This message is in reply to a prev 1 . My application refues to close . Some one had suggested that I might have threads running.. but i solved that problem too . The app still refuses to close...
1
by: Alpha | last post by:
I have a Window based application that shows up still running in the task manager when I close it. It reaches the "this.close" statement and then it stops at the "}" at the section of the...
1
by: s-galit | last post by:
hi, i have a module that created a form, and the messageBox is shown in the closing event , but when the im choosing the "cancel" button in the messageBox the messageBox and also the form is...
0
by: archana | last post by:
Hi all, I am facing very strange problem while using webrequest. What i am doing is i have one url which i want to validate. so i am using webrequest and webresponse. My code is as below:-...
3
by: rdemyan via AccessMonster.com | last post by:
Sometimes users (including myself) accidentally click on the application close icon in the application menu bar when they meant to just click on the 'X' for the form. Of course the app closes and...
6
by: Frank Rizzo | last post by:
I am trying to programmatically close a messagebox. I don't see any obvious managed choices. Back in the day, I remember using a combination of FindWindow and EndDialog apis(...
0
by: uneasyrider | last post by:
OK I'm about to pull my hair out on this one. I've got a socket created that sends a network stream of data from a listview to an open port. It works great!! I'm getting ACK's back from the server...
3
Fr33dan
by: Fr33dan | last post by:
Hi All, I'm working on adding a message box method that will allow me to display a message to the user without waiting for the user to answer. I've done this by starting MessageBox.Show in a...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.