2

C#的窗体假关闭操作例子 - 开源研究系列文章 - lzhdim

 4 weeks ago
source link: https://www.cnblogs.com/lzhdim/p/18120185
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

C#的窗体假关闭操作例子 - 开源研究系列文章

Posted on 2024-04-19 09:30  lzhdim  阅读(98)  评论(0)  编辑  收藏  举报

       晚上编码的时候,想到了以前编写的窗体关闭的事情,就是带托盘图标的应用,有一个主显示操作窗体,但是主窗体点击关闭按钮的时候,实际上是窗体隐藏而非真正关闭,这个在其它的一些应用程序里有这个效果。于是就想到了这个例子,记录下来,如果其他读者也有这个问题,那直接复用此例子的代码即可。

  1、 项目目录;

   

o_240407163158_1.png

  2、 源码介绍;

  1) 拦截关闭操作的代码;

   

o_240407163203_2.png

  2) 真正关闭窗体的代码;

   

o_240407175405_3.png

  3、 运行界面;

  因为未对窗体界面进行处理,所以这里没界面效果截图。

  4、 使用介绍;

   

o_240407175410_4.png

  5、 源码下载;

  提供源码下载:https://download.csdn.net/download/lzhdim/89097181

  6、 其它建议;

  这是个简单明了的例子,请读者自己扩展该应用。

       上面介绍了C#的假关闭窗体的代码以及真正关闭窗体的代码,需要的读者请自己复用此例子的代码即可。

o_230607054137_lzhdim.png     Austin Liu  刘恒辉

Lzhdim Group's Chairman,Project Manager and Software Designer
    E-Mail:[email protected]
    Blog:https://lzhdim.cnblogs.com

欢迎收藏和转载此博客中的博文,但是请注明出处,给笔者一个与大家交流的空间。谢谢大家。

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK