-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: KAPILGOYAL-KG
Message 2 in Discussion
Hi
I think u want to use
singleton class methodology. for this
U need to do three things
Step1: define this into
class
''for single ton object
Public Shared singleTon
As frmImportFeed
Public Shared flag As Boolean
Step2: method used in
class
Friend Shared Function getSingletonObject() As
frmImportFeed
If flag = False
Then
singleTon = New
frmImportFeed()
flag =
True
Return singleTon
Else
singleTon.BringToFront()
Return singleTon
End
If
End Function
Private Sub frmImportFeed_Closing(ByVal sender As
Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles
MyBase.Closing
'singleTon =
Nothing
flag = False
End
Sub
Step3: method attach to menu cilck
event
Private Sub mnuImportFeedFile_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
mnuImportFeedFile.Click
Dim
frmImportFeed As frmImportFeed
frmImportFeed = frmImportFeed.getSingletonObject
'Set its
mid parent
frmImportFeed.MdiParent
= Me
frmImportFeed.Show()
End
Sub
KG/Anupam
(GISIL)
----- Original Message -----
From:
dotnet_ramu
To: BDOTNET
Sent: Tuesday, July 27, 2004 11:14
PM
Subject: Please Convert this C# code to
VB.net Code
New Message on BDOTNET
Please
Convert this C# code to VB.net Code
Reply
Reply to Sender Recommend
Message 1 in
Discussion
From: dotnet_ramu
hi,
can anybody convert this code to vb.net
//Used for singleton pattern
static
frmChildForm childForm;
public
static ChildForm GetInstance
{
if
(childForm == null)
childForm
= new frmChildForm;
return
childForm;
}
*****************************************************
frmChildForm childForm = frmChildForm.GetInstance();
childForm.MdiParent
= this;
childForm.Show();
childForm.BringToFront();
View other groups in this
category.
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]