Example #1
0
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            MyForm form = new MyForm();

            form.Show();
            Application.DoEvents();
            foreach (string arg in args)
            {
                if (!string.IsNullOrEmpty(arg))
                {
                    char c = arg[0];
                    if (c == '-' || c == '/')
                    {
                        switch (arg.Substring(1).ToLowerInvariant())
                        {
                        case "offset":
                            form.Location = new System.Drawing.Point(form.Location.X + 20, form.Location.Y + 20);
                            break;
                        }
                    }
                    else
                    {
                        form.Open(arg);
                    }
                }
            }
            Application.Run(form);
        }
Example #2
0
        static void Main(string[] args)
        {
            if (Environment.GetEnvironmentVariable("XML_NOTEPAD_DISABLE_HIGH_DPI") == "1")
            {
                var section = ConfigurationManager.GetSection("System.Windows.Forms.ApplicationConfigurationSection") as NameValueCollection;
                section.Set("DpiAwareness", "false");
            }
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            MyForm form = new MyForm();

            form.Show();
            Application.DoEvents();
            foreach (string arg in args)
            {
                if (!string.IsNullOrEmpty(arg))
                {
                    char c = arg[0];
                    if (c == '-' || c == '/')
                    {
                        switch (arg.Substring(1).ToLowerInvariant())
                        {
                        case "offset":
                            form.Location = new System.Drawing.Point(form.Location.X + 20, form.Location.Y + 20);
                            break;
                        }
                    }
                    else
                    {
                        form.Open(arg);
                    }
                }
            }
            Application.Run(form);
        }
Example #3
0
 static void Main(string[] args)
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     MyForm form = new MyForm();
     form.Show();
     Application.DoEvents();
     foreach(string arg in args){
         if (!string.IsNullOrEmpty(arg)) {
             char c = arg[0];
             if (c == '-' || c == '/') {
                 switch (arg.Substring(1).ToLowerInvariant()) {
                     case "offset":
                         form.Location = new System.Drawing.Point(form.Location.X + 20, form.Location.Y + 20);
                         break;
                 }
             } else {
                 form.Open(arg);
             }
         }
     }
     Application.Run(form);
 }