Create a Windows Form

Add two buttons as following figure.



The first time you clicked the “Run” button, the following two dialogs will show up.

And then another dialog follows

The second time you click the “Run” button, you can only see the above dialog.

Since the instance does exist, no more constructor or initialization is needed!


sample code: SingletonPattern_ex.rar

文章標籤
全站熱搜
創作者介紹
創作者 me1237guy 的頭像
me1237guy

天天向上

me1237guy 發表在 痞客邦 留言(0) 人氣(13)