• Initialize Controls


    You can write a new method to reset the controls and then call it in the method "Submit_Click".

    private void Reset()
    {
        checkBox1.CheckState = CheckState.Unchecked;
        checkBox2.CheckState = CheckState.Unchecked;
        // ...
        textBox1.Text = string.Empty;
        textBox2.Text = string.Empty;
        // ...
    }
    
    private void Submit_Click(object sender, EventArgs e)
    {
        // any other operation, like saving/renaming a file
        Reset();
    }

    If you want to initialize all controls, you can use the following code to implement it.

    private void Submit_Click(object sender, EventArgs e)
    {
        // any other operation, like saving/renaming a file
        Controls.Clear();
        InitializeComponent();
    }
  • 相关阅读:
    windows nginx
    stdClass 标准
    array_merge
    array_pop
    array_push
    array_unique
    GMT与UTC简介(转)
    curl-手册
    13.5. zipfile — Work with ZIP archives
    7. Input and Output
  • 原文地址:https://www.cnblogs.com/jizhiqiliao/p/9881704.html
Copyright © 2020-2023  润新知