close

Create a Windows Form

image

Add two buttons as following figure.

image


image

image

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

image

image

And then another dialog follows

image

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) 人氣()