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 LoadForm()//设置窗口 { this.Icon = Properties.Resources.ForceTer; this.BackgroundImage = Sqlite.GetBackgroundImage(); this.BackgroundImageLayout = ImageLayout.Stretch; this.TopMost = true; }
private void LoadForm()//设置窗口首次启动的操作 { this.Name = this.Name + " 3.0"; this.FormBorderStyle = FormBorderStyle.None; this.Width = setting.Width; this.Height = setting.Height; Rectangle rect = Screen.GetWorkingArea(this); this.Left = rect.Width / 2 - this.Width / 2; this.Top = rect.Height / 2 - this.Height / 2; this.BackgroundImage = Sqlite.GetBackgroundImage(); this.BackgroundImageLayout = ImageLayout.Stretch; this.Icon = Properties.Resources.ForceTer; this.TopMost = setting.Top ? true : false; }
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); } } }
public void LoadBackgroud(int width, int height, string name)//加载修改图标的界面 { this.FormBorderStyle = FormBorderStyle.None; SetLabel(name, 12, 10, "微软雅黑", 10); this.Width = width; this.Height = height; Rectangle rect = Screen.GetWorkingArea(this); this.Left = rect.Width / 2 - this.Width / 2; this.Top = rect.Height / 2 - this.Height / 2; SetLabel("当前系统皮肤", this.Width / 4 - 47, 55, "微软雅黑", 10); SetLabel("请在下方拖入新的皮肤图片", this.Width / 4 * 3 - 83, 55, "微软雅黑", 10); SetPictureBoxBackgroud(this.Width / 4 - 120, this.Height / 2 - 90, 240, 180, false, Sqlite.GetBackgroundImage()); SetPictureBox(this.Width / 2 - 25, this.Height / 2 - 10, 50, 20, false, false, Properties.Resources._goto, true); SetPictureBoxBackgroud(this.Width / 4 * 3 - 120, this.Height / 2 - 90, 240, 180, true, null); }