ThePentiumGuy Posted June 16, 2003 Posted June 16, 2003 under which event do u make it so that when u click the X button it displays, "Are you sure u want to exit" (yes or no) i tried form1.closing and form1.closed but it doesnt work which event do u need. Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
Leaders dynamic_sysop Posted June 16, 2003 Leaders Posted June 16, 2003 Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing If MsgBox("are you sure you want to quit", MsgBoxStyle.OKCancel, Application.ProductName) = MsgBoxResult.OK Then e.Cancel = False Else e.Cancel = True End If that should sort you out :) Quote
capwrmt Posted June 16, 2003 Posted June 16, 2003 form.closing is used when you want to display the "are you sure you want to close prompt" Private Sub frmT_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing If MsgBox("Are you sure you want to close?", MsgBoxStyle.YesNo, "Close?") = MsgBoxResult.Yes Then Application.exit else 'don't exit app e.Cancel = True end if End Sub Quote
ThePentiumGuy Posted June 17, 2003 Author Posted June 17, 2003 ok thanx, btw whats the dif between what capwrmt said and what dynamic_sysop said .. lol they're the same except the End Sub Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
Leaders dynamic_sysop Posted June 17, 2003 Leaders Posted June 17, 2003 if Cancel is False then the application can exit , if it's true then it wont. both them ways provide the same result anway thats the main thing:p Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.