private void CreateDiabloBox(DiabloInfo diablo) { GroupBox gb = new GroupBox(); gb.Text = "Window Title:"; if (diablo.WindowTitle != "" && diablo.WindowTitle != null) { gb.Text += Environment.NewLine + diablo.WindowTitle; } gb.Size = new Size(87, 100); Button btn = new Button(); btn.Text = diablo.ButtonText; btn.Tag = diablo; btn.Click += Btn_Click; gb.Controls.Add(btn); btn.Location = new Point(6, 46); TextBox txt = new TextBox(); txt.Tag = diablo; txt.Name = "txtArgs" + diablo.ToString(); txt.Text = diablo.Arguments; txt.TextChanged += Txt_TextChanged; txt.Size = new Size(87, 20); gb.Controls.Add(txt); txt.Location = new Point(0, 74); Label lbl = new Label(); lbl.Text = "?"; lbl.Font = new Font(lbl.Font.Name, lbl.Font.SizeInPoints, FontStyle.Underline); SetToolTip(lbl, "DiabloInfo:" + Environment.NewLine + diablo.GamePath + Environment.NewLine + diablo.Arguments + Environment.NewLine + diablo.WindowTitle + Environment.NewLine + diablo.ButtonText + Environment.NewLine + "RunAsAdmin: " + (diablo.RunAsAdmin ? "True": "False") + Environment.NewLine + "UseGlideSettings: " + (diablo.UseGlideSettings ? "True" : "False") + Environment.NewLine + "GlideSettings:" + Environment.NewLine + "WindowMode: " + diablo.GlideSettings.WindowMode + Environment.NewLine + "CaptureMouse: " + diablo.GlideSettings.CaptureMouse + Environment.NewLine + "StaticSize: " + Helper.GetEnumDescription(diablo.GlideSettings.StaticSize) + Environment.NewLine + "DesktopResolution: " + diablo.GlideSettings.DesktopResolution); lbl.Cursor = Cursors.Hand; gb.Controls.Add(lbl); lbl.Location = new Point(75, 0); flpDiabloBoxes.Controls.Add(gb); }
private void Btn_Click(object sender, EventArgs e) { DiabloInfo d2 = (DiabloInfo)((Button)sender).Tag; string args = ((TextBox)((GroupBox)((Button)sender).Parent).Controls["txtArgs" + d2.ToString()]).Text; d2.Arguments = args; dm.StartDiablo(d2, this); }