c#编辑框-组合框-鼠标失去焦点后-绑定事件-如自动保存参数-鼠标移动

   private void save_ip_port(object sender, EventArgs e)
        {
            string content = comboBox1.Text + "\r\n" + textBox_server_port.Text;
            Http_Class.WriteConfigFile(content);
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            textBox_server_port.LostFocus += new EventHandler(save_ip_port);
            comboBox1.LostFocus += new EventHandler(save_ip_port);

使用LostFoucs

posted @ 2021-06-24 15:28  txwtech  阅读(120)  评论(0编辑  收藏  举报