如何避免在C#中的Windows窗体的多个实例 [英] How to avoid multiple instances of windows form in c#
本文介绍了如何避免在C#中的Windows窗体的多个实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何避免在C#中的Windows窗体的多个实例?我想要的形式运行的只有一个实例。因为有从我的应用程序的多个页面打开同一形式的机会。
How to avoid multiple instances of windows form in c# ?? i want only one instance of the form running. Because there are chances of opening the same form from many pages of my application.
推荐答案
实现的 Singleton模式
一个例子: $ C $的CProject:简单辛格尔顿形式(好吧,这是在VB.NET,但只给你一个线索)
an example: CodeProject: Simple Singleton Forms (ok, it's in VB.NET, but just to give you a clue)
这篇关于如何避免在C#中的Windows窗体的多个实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文