Title: MyApplication Startup next Instance                                 If you need copy same format use firefox or chrome or safari but iexplorer not work


Preview of Code
 
Imports System.Globalization
Imports System.Threading
 
Namespace My
 
    Partial Friend Class MyApplication
        Private Sub MyApplication_Startup(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.StartupEventArgs) Handles Me.Startup
 
            `
            Try
 
                `     `لجعل البرنامج بالتاريخ الإنجليزي وليس الهجري 
                `    Dim Dt As New DateTime
                `   Dt = db.GrgCalendar((Now.Year), (Now.Month), (Now.Day))
                `
                ` جعل لوحة المفاتيج باللغة العربية - من اليمن الى اليسار
                InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(New CultureInfo("Ar-SA"))
            Catch ex As Exception
            End Try
 
        End Sub
 
        Private Sub MyApplication_StartupNextInstance(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.StartupNextInstanceEventArgs) Handles Me.StartupNextInstance
            Dim inputArgument As String = "/input="
            Dim inputName As String = ""
            For Each s As String In e.CommandLine
                If s.ToLower.StartsWith(inputArgument) Then
                    inputName = s.Remove(0, inputArgument.Length)
                End If
            Next
            If inputName = "" Then
                MsgBox("لا يسمح بتشغيل اكثر من نسخة واحدة " & vbCrLf & "يوجد نسخة من هذا البرنامج تعمل حالياً", MsgBoxStyle.Critical Or MsgBoxStyle.MsgBoxRight, "تعدد النسخ")
            Else
                MsgBox("Input name: " & inputName)
            End If
 
        End Sub
    End Class
 
End Namespace