I have a formdlg which can be accessed from two 2 forms
For button click on Form1, it needs to be instance- can have multiple formdlg
But from the other place, I would need only a single instance of formdlg
Any ideas
Thank u
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Following is an example code of the class which can provide the answer for you.
Since the constructor is public you can call new in the Form1 to get multiple instances anytime you want.
In form2 use the static function GetInstance to retreive the single instance everytime.
Hope this helps.