close
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
全站熱搜