Beispiel #1
0
 private void btnFontDialog_Click(object sender, EventArgs e)
 {
     NetCharm.Common.FontDialog dlgFont = new NetCharm.Common.FontDialog();
     dlgFont.Apply += new System.EventHandler(dlgFont_Apply);
     //dlgFont.Color = color;
     dlgFont.SelectedFont = SystemFonts.DefaultFont;
     dlgFont.FontSize     = 14f;
     if (dlgFont.ShowDialog() == DialogResult.OK)
     {
         //
     }
     else
     {
         //option.TextColor = c;
         //Preview();
     }
     return;
 }
Beispiel #2
0
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(true);

            //if(Environment.CommandLine)
            if (args.Length > 0)
            {
                if (args[0].StartsWith("Color", StringComparison.CurrentCultureIgnoreCase))
                //if (string.Equals(args[0], "Color", StringComparison.CurrentCultureIgnoreCase))
                {
                    NetCharm.Common.ColorDialog dlgColor = new NetCharm.Common.ColorDialog();
                    dlgColor.Icon          = Resources.ColorDialog;
                    dlgColor.ShowInTaskbar = true;
                    dlgColor.ShowIcon      = true;
                    dlgColor.ShowApply     = false;
                    dlgColor.Color         = Color.White;
                    if (dlgColor.ShowDialog() == DialogResult.OK)
                    {
                    }
                }
                else if (args[0].StartsWith("Font", StringComparison.CurrentCultureIgnoreCase))
                {
                    NetCharm.Common.FontDialog dlgFont = new NetCharm.Common.FontDialog();
                    dlgFont.Icon          = Icon.ExtractAssociatedIcon(Application.ExecutablePath);
                    dlgFont.ShowInTaskbar = true;
                    dlgFont.ShowIcon      = true;
                    dlgFont.ShowApply     = false;
                    dlgFont.SelectedFont  = SystemFonts.DefaultFont;
                    dlgFont.FontSize      = 14f;
                    if (dlgFont.ShowDialog() == DialogResult.OK)
                    {
                    }
                }
                else
                {
                    Application.Run(new MainForm());
                }
            }
            else
            {
                Application.Run(new MainForm());
            }
        }