using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace HisenceYoloDetection { public partial class Form2 : Form { public string EnteredPassword { get; private set; } public Form2() { InitializeComponent(); button1.Click += button1_Click; // 订阅按钮点击事件 } private void button1_Click(object sender, EventArgs e) { EnteredPassword = textBox1.Text; DialogResult = DialogResult.OK; Close(); } private void Form2_Load(object sender, EventArgs e) { CenterToScreen(); } private void label1_Click(object sender, EventArgs e) { } } }