Login
Search
Welcome to the iTechForums.
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
To register now click here.
Latest Threads
Advertisements
Forum Statistics
Threads:
Posts: 4
Members:
Number of Users Online:
Welcome to our newest member,
Reply
 
Thread Tools Display Modes
  #1  
Old 05-06-2008, 06:14 PM
Shyne GFX Shyne GFX is offline
Junior Member
 
Join Date: May 2008
Posts: 1
Default

Visual Basic 2008 Exit Button?


Ok i dont just want a button which when i press to terminate the program. i know how to do that. i want went i press a button a message box to pop up with the options Yes and No and if i press Yes its then terminates the program and hence if i press No it goes back to the form.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 05-06-2008, 06:14 PM
Lapband Man Lapband Man is offline
Junior Member
 
Join Date: May 2008
Posts: 4
Default

Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
If MessageBox.Show("Close", "Closing Application", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then
Exit Sub
End If
e.Cancel = True
End Sub
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 05-06-2008, 06:15 PM
u1bd66 u1bd66 is offline
Junior Member
 
Join Date: May 2008
Posts: 2
Default

it might be something like (bare in mind I use VB6 so it may differ)

If msgbox ("Are you sure you wish to quit?", vbYesNo) = vbYes then
Unload me
Else
End If
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Your Ad Here

All times are GMT. The time now is 03:16 PM.