示例#1
0
        private void frmMain_Load(object sender, EventArgs e)
        {
            //cropElipPanel();
            checkIntStyleWinform();
            //Properties.Settings.Default.Reset();
            SaveSettingForm.IntializeForm(this);

            blureForm.SetLocations = this.Location;
            blureForm.SetSize      = this.Size;
            blureForm.Intialization();
            Aero.EnableAcrylic(blureForm.frmBlueGone, Color.Transparent);

            //pnAutoPIP.BackgroundImage = (Properties.Settings.Default.FAutoPIP) ? Properties.Resources.done_red : Properties.Resources.done;
            if (Properties.Settings.Default.FAutoPIP)
            {
                pnAutoPIP.BackgroundImage = Properties.Resources.done_red;
                pnDF.BackColor            = Color.IndianRed;
            }
            else
            {
                pnAutoPIP.BackgroundImage = Properties.Resources.done;
                pnDF.BackColor            = Color.MediumSeaGreen;
            }

            toolTipText();

            Library.is_openedwindows = true;

            this.TopMost = Properties.Settings.Default.FIsShowTop;

            frmShow();

            if (!is_showicontray)
            {
                is_showicontray = true;
                frmIconTray frmicon = new frmIconTray();
                frmicon.Show();
            }

            Thread thload = new Thread(new ThreadStart((() =>
            {
                if (this.InvokeRequired)
                {
                    this.BeginInvoke((MethodInvoker) delegate()
                    {
                        load();
                    });
                }
                else
                {
                    load();
                }
            })));

            thload.Start();
        }
示例#2
0
 private void frmMain_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (!isEndProcess && Properties.Settings.Default.FIsRunbackground)
     {
         if (isNotExit)
         {
             e.Cancel = isNotExit;
             frmHide();
         }
         else
         {
             if (MetroMessageBox.Show(this, "Bạn có muốn thoát ?", "Alert !", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
             {
                 if (Library.is_Messenging_Start)
                 {
                     Library.Show_Close_PoupupMessenging(false);
                 }
                 try
                 {
                     if (this.InvokeRequired)
                     {
                         this.BeginInvoke((MethodInvoker) delegate()
                         {
                             frmClose();
                             SaveSettingForm.SaveForm(this);
                         });
                     }
                     else
                     {
                         frmClose();
                         SaveSettingForm.SaveForm(this);
                     }
                 }
                 catch
                 {
                     Cef.Shutdown();
                     e.Cancel = false;
                 }
             }
             else
             {
                 isNotExit = true;
                 e.Cancel  = true;
             }
         }
     }
 }