-----------------------------------------------------------
New Message on cochindotnet
-----------------------------------------------------------
From: Z?�n
Message 2 in Discussion
Prevent Multiple Instances of a .NET Windows Application ''Add this code in the
form_load event.. (the form which loaded and shown
as the first form)
''This works well with an MDI form or a non-MDI form
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If
UBound(Diagnostics.Process.GetProcessesByName(Diagnostics.Process.GetCurrentProcess.ProcessName))
> 0 Then
''Send opening form's TEXT property as a parameter to the function
"ActivatePrevInstance"
''This works well with an MDI form or a non-MDI form
''It is advised that you give a Unique name to your Form so that it
doenot conflict with other applications
ActivatePrevInstance(TEXT_PROPERTY_OF_OPENING_FORM)
End If
End Sub
(Full Source)
http://www.devx.com/tips/Tip/20044
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/cochindotnet/_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]