Exemple #1
0
 private void Lb_MouseClick2(object sender, MouseEventArgs e)
 {
     if (names == "ForceTer Setting")
     {
         if (MessageBox.Show("\r\n是否将ForceTer还原为初始状态?\r\n此操作会将所有添加的图标,背景图,点击率,等内容删除(不可恢复) !", "ForceTer 3.0", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
         {
             if (Sqlite.GetSetting().Start)
             {
                 AddStart(false);                           //设置开机启动的项目
             }
             Sqlite.SetBackgroundImage("\\localhost");
             Sqlite.SetSetting(new Setting(false, true, true, false, false, "1024×768(推荐)", 1024, 768));
             ft.ReloadForm();
             ft.BackgroundImage           = Sqlite.GetBackgroundImage();
             ft.Enabled                   = true;
             ft.contextMenuStrip1.Enabled = true;
             Sqlite.DelMenuAll();
             Files.DeleteFileAll();
             ft.imageList1.Images.Clear();
             ft.lv.Clear();
             ft.lv.Items.Clear();
             ft.Show();
             this.Close();
         }
         return;
     }
 }
Exemple #2
0
        private void Lb_MouseClick3(object sender, MouseEventArgs e)//应用设置里边的修改内容
        {
            Setting s       = new Setting();
            Setting setting = Sqlite.GetSetting();

            foreach (Control ctrl in this.Controls)
            {
                if ((string)ctrl.Tag == "开机启动")
                {
                    Boolean strat = (((CheckBox)ctrl).CheckState == CheckState.Checked);
                    if (setting.Start != strat)
                    {
                        if (!AddStart(strat))
                        {
                            ((CheckBox)ctrl).CheckState = setting.Start?CheckState.Checked:CheckState.Unchecked;
                            MessageBox.Show(" 提醒 : \r\n\t未同意管理员请求,设置失败! ", "ForceTer");
                            return;
                        }
                    }
                    s.Start = ((CheckBox)ctrl).CheckState == CheckState.Checked ? true : false;
                }
                else if ((string)ctrl.Tag == "前台显示")
                {
                    s.Top = ((CheckBox)ctrl).CheckState == CheckState.Checked ? true : false;
                }
                else if ((string)ctrl.Tag == "退出时提示")
                {
                    s.Exit = ((CheckBox)ctrl).CheckState == CheckState.Checked ? true : false;
                }
                else if ((string)ctrl.Tag == "打开程序后隐藏")
                {
                    s.Openfile = ((CheckBox)ctrl).CheckState == CheckState.Checked ? true : false;
                }
                else if ((string)ctrl.Tag == "打开文件位置后隐藏")
                {
                    s.Openfoder = ((CheckBox)ctrl).CheckState == CheckState.Checked ? true : false;
                }
                else if ((string)ctrl.Tag == "type")
                {
                    s.Desktop = ((ComboBox)ctrl).Text;
                }
            }
            Sqlite.SetSetting(s);
            ft.ReloadForm();
            Pb_MouseClick4(sender, e);
        }