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; } }
private void Lb_MouseClick4(object sender, MouseEventArgs e)//还原默认 { SetSetting(new Setting(false, true, true, false, false, "1024×768(推荐)", 1024, 768)); if (names != "ForceTer Setting") { if (MessageBox.Show("是否将背景图还原为初始图像 ?", "ForceTer 3.0", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) { Sqlite.SetBackgroundImage("\\localhost"); ft.BackgroundImage = Sqlite.GetBackgroundImage(); ft.Enabled = true; ft.contextMenuStrip1.Enabled = true; ft.Show(); this.Close(); } } }
private void Lb_MouseClick1(object sender, MouseEventArgs e)//点击了确定程序按钮 { foreach (Control ctrl in this.Controls) { if ((string)ctrl.Tag == "name") { string name = ((TextBox)ctrl).Text; if (name.Trim() != "") { Sqlite.RemMenuName(this.Tag.ToString(), name); } Pb_MouseClick4(sender, e); ft.LoadMenu(ft.JudgeType(), true); return; } if ((string)ctrl.Tag == "icon") { if (icoAddress == null) { return; } Image i = System.IO.File.Exists(icoAddress) ? Icon.ExtractAssociatedIcon(icoAddress).ToBitmap() : Properties.Resources.Project; Files.DeleteFile(this.Tag.ToString() + ".png"); Files.SaveImageFile(this.Tag.ToString() + ".png", i); ft.LoadMenu(ft.JudgeType(), true); Pb_MouseClick4(sender, e); } if ((string)ctrl.Tag == "png") { if (icoAddress == null) { return; } System.IO.File.Copy(icoAddress, "image\\backgroud." + this.Tag.ToString(), true); Sqlite.SetBackgroundImage("backgroud." + this.Tag.ToString()); ft.BackgroundImage = Sqlite.GetBackgroundImage(); Pb_MouseClick4(sender, e); } } }