Uncloseable event : Form Event « GUI Windows Form « C# / C Sharp

C# / C Sharp
1. 2D Graphics
2. Collections Data Structure
3. Components
4. Database ADO.net
5. Development Class
6. Event
7. File Stream
8. GUI Windows Form
9. Language Basics
10. Network
11. Office
12. Regular Expressions
13. Services Event
14. Thread
15. Web Services
16. Windows
17. XML
Microsoft Office Word 2007 Tutorial
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / CSharp Tutorial
ASP.Net
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
C# / C Sharp » GUI Windows Form » Form EventScreenshots 
Uncloseable event
Uncloseable event


  using System;
  using System.Drawing;
  using System.Collections;
  using System.ComponentModel;
  using System.Windows.Forms;
  using System.Data;

  public class Form1 : System.Windows.Forms.Form
  {
    private Button myButton; 

    public Form1()
    {
      this.AutoScaleBaseSize = new System.Drawing.Size(513);
      this.ClientSize = new System.Drawing.Size(292273);
        
            this.Closing+=new CancelEventHandler(Form_Closing);

      myButton = new Button();
      myButton.Text = "www.java2s.com";
      myButton.Location = new System.Drawing.Point(6432);
      myButton.Size = new System.Drawing.Size(15050);
 
      Controls.Add(myButton);
    }
        public void Form_Closing(object sender,CancelEventArgs cArgs) {
            cArgs.Cancel=true
        }
    static void Main() 
    {
      Application.Run(new Form1());
    }
  }

           
       
Related examples in the same category
1. Cancel EventCancel Event
2. Bind key action to a form windowBind key action to a form window
3. Form window closing eventForm window closing event
4. Form window load eventForm window load event
5. Form resize and redrawForm resize and redraw
6. Form Mouse down actionForm Mouse down action
7. Form Key Press actionForm Key Press action
w_w_w___.___j_a___v__a_2___s_.c___o_m___ | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.