Jump to content
manuelsousa7

[Resolvido] Dúvida VB 2010 - Duvida ou fechar form

Recommended Posts

manuelsousa7

Boas,

Estou com umas duvidas aqui com um projeto. Aquilo que eu queria era que quando fecha-se o formulário (um qualquer) iria aparecer um msgbox ou algo do género. o que eu quero saber é o evento que eu tenho de chamar para poder programar no "fechar programa".

Tipo isto:

if [Aquilo que eu quero saber e que faz fechar o programa] = True Then
msgbox("Olá")
Endif

Share this post


Link to post
Share on other sites
ruiribeiro
   Private Sub Form1_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing

       Dim result As DialogResult = MessageBox.Show("Close Form?", "Yeehaw!", MessageBoxButtons.YesNo)
       If result = Windows.Forms.DialogResult.No Then
           e.Cancel = True
       End If

   End Sub


Rui Ribeiro

.NET/T-SQL, JAVA, PHP, Javascript Developer

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.