📄 dlg_name.cs
字号:
//
this.maskedTextBox10.Location = new System.Drawing.Point(358, 108);
this.maskedTextBox10.Mask = "99";
this.maskedTextBox10.Name = "maskedTextBox10";
this.maskedTextBox10.PromptChar = ' ';
this.maskedTextBox10.Size = new System.Drawing.Size(21, 21);
this.maskedTextBox10.TabIndex = 14;
this.maskedTextBox10.Text = "0";
this.maskedTextBox10.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(12, 117);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(95, 12);
this.label2.TabIndex = 15;
this.label2.Text = "所需资源(1-10):";
//
// button1
//
this.button1.Location = new System.Drawing.Point(73, 186);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(90, 29);
this.button1.TabIndex = 16;
this.button1.Text = "取消";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(119, 94);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(11, 12);
this.label3.TabIndex = 17;
this.label3.Text = "1";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(145, 94);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(11, 12);
this.label4.TabIndex = 18;
this.label4.Text = "2";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(173, 94);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(11, 12);
this.label5.TabIndex = 19;
this.label5.Text = "3";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(201, 94);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(11, 12);
this.label6.TabIndex = 20;
this.label6.Text = "4";
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(227, 94);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(11, 12);
this.label7.TabIndex = 21;
this.label7.Text = "5";
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(255, 94);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(11, 12);
this.label8.TabIndex = 22;
this.label8.Text = "6";
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(280, 94);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(11, 12);
this.label9.TabIndex = 23;
this.label9.Text = "7";
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(309, 94);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(11, 12);
this.label10.TabIndex = 24;
this.label10.Text = "8";
//
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(335, 94);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(11, 12);
this.label11.TabIndex = 25;
this.label11.Text = "9";
//
// label12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(358, 94);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(17, 12);
this.label12.TabIndex = 26;
this.label12.Text = "10";
//
// dlg_name
//
this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.ClientSize = new System.Drawing.Size(405, 227);
this.Controls.Add(this.label12);
this.Controls.Add(this.label11);
this.Controls.Add(this.label10);
this.Controls.Add(this.label9);
this.Controls.Add(this.label8);
this.Controls.Add(this.label7);
this.Controls.Add(this.label6);
this.Controls.Add(this.label5);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.button1);
this.Controls.Add(this.label2);
this.Controls.Add(this.maskedTextBox10);
this.Controls.Add(this.maskedTextBox9);
this.Controls.Add(this.maskedTextBox8);
this.Controls.Add(this.maskedTextBox7);
this.Controls.Add(this.maskedTextBox6);
this.Controls.Add(this.maskedTextBox5);
this.Controls.Add(this.maskedTextBox4);
this.Controls.Add(this.maskedTextBox3);
this.Controls.Add(this.maskedTextBox2);
this.Controls.Add(this.maskedTextBox1);
this.Controls.Add(this.label1);
this.Controls.Add(this.bn_1);
this.Controls.Add(this.tb_name_1);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "dlg_name";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "请输入进程名";
this.ResumeLayout(false);
this.PerformLayout();
}
private void bn_1_Click(object sender, EventArgs e)
{
to_res();
for (int i = 0; i < 10; i++)
{
if (res[i] > total[i]) { MessageBox.Show("第"+(i+1).ToString()+"类资源要求总数大于系统总资源数,请重新输入!"); break; }
else if (i == 9) { stat = true; Close(); }
}
}
private void button1_Click(object sender, EventArgs e)
{
Close();
}
private void to_res()
{
res[0] = int.Parse(maskedTextBox1.Text.ToString());
res[1] = int.Parse(maskedTextBox2.Text.ToString());
res[2] = int.Parse(maskedTextBox3.Text.ToString());
res[3] = int.Parse(maskedTextBox4.Text.ToString());
res[4] = int.Parse(maskedTextBox5.Text.ToString());
res[5] = int.Parse(maskedTextBox6.Text.ToString());
res[6] = int.Parse(maskedTextBox7.Text.ToString());
res[7] = int.Parse(maskedTextBox8.Text.ToString());
res[8] = int.Parse(maskedTextBox9.Text.ToString());
res[9] = int.Parse(maskedTextBox10.Text.ToString());
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -