Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
  Database
Automation
OS/Networking
Graphics
Links
Tools
» Regular Expr Tester
» Free Tools

Protect the form unloading in accidently

Total Hit ( 1451)

Rate this article:     Poor     Excellent 

 Submit Your Question/Comment about this article

Rating


 


When you want ot protect the form unload in accidently you can use this following code.
In this code, the action is When a form is prepared to
unload The unload event was automatically raised.
on that event there is an parameter named "Cancel" which in the data type integer.
When the unload event is raised the "cancel" has the value as 0.
If the value of "Cancel" is 0 the form is automatically unloaded.
If we change the value to 1 the form was never end. So I wrote the code as follows...

Click here to copy the following block
private sub form1_unload(Cancel as Integer)
  a = MsgBox "Do u want to close?",vbYesNo,"Alert Message"
  If a = vbYes Then
    Cancel = 0
  Else
    Cancel = 1
  End If
End Sub


Submitted By : Nayan Patel  (Member Since : 5/26/2004 12:23:06 PM)

Job Description : He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting.
View all (893) submissions by this author  (Birth Date : 7/14/1981 )


Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.