Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pitanje pri zatvaranju
Author Message
Peki_92 Offline
Novi korisnik
*

Posts: 42
Joined: Jan 2010
Reputation: 0
Post: #1
Question pitanje pri zatvaranju
kada kliknem x na formi i pre njenog zatvaranja treba da mi se pojavi msgbox


Dim mes As New Microsoft.VisualBasic.MsgBoxResult

mes = MessageBox.Show("Zelite li da napustite aplikaciju?", "Izlaz", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2)
If mes = MsgBoxResult.Yes Then
End
Else

End If

e sad. kada kliknem yes, on je zatvori i to je ok. ali kada kliknem no. on je zatvori ali je aplikacija jos uvek running, samo je sakrije. kako se ovo radi...? hvala
06-04-2010 02:29 PM
Find all posts by this user Quote this message in a reply
r0tring Offline
Redoviti posjetitelj
**

Posts: 230
Joined: Apr 2009
Reputation: 10
Post: #2
RE: pitanje pri zatvaranju
Code:
Public Class Form1

    Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        
            If MsgBox("Izlazite?", MsgBoxStyle.YesNoCancel) = MsgBoxResult.Yes Then
                End
            Else
                e.Cancel = True
            End If
        
    End Sub

End Class
(This post was last modified: 06-04-2010 07:19 PM by r0tring.)
06-04-2010 07:16 PM
Find all posts by this user Quote this message in a reply
Peki_92 Offline
Novi korisnik
*

Posts: 42
Joined: Jan 2010
Reputation: 0
Post: #3
RE: pitanje pri zatvaranju
hvala...
06-04-2010 09:01 PM
Find all posts by this user Quote this message in a reply
kecko Offline
Forumaš
***

Posts: 647
Joined: Nov 2009
Reputation: 20
Post: #4
RE: pitanje pri zatvaranju
reagiraš na formclosing event, ako ne želiš da se forma ugasi imaš e.Cancel flag i postaviš na true, pogledaj si malo sve evente koje imaš i EventArgsobjekte, Intellinsense u VS ti ej zakon za to :)
07-04-2010 01:17 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)