C# disable textbox focus on form load

2020-05-09 23:17发布

问题:

I have a textbox which I want to disable focus for it How do I disable focus for Textbox with Programming

disable textbox focus using programming c# , I have used below two codes not working:

textBox1.focus()=false;

textBox1.focused()=false;

回答1:

You can set this.ActiveControl = null; with this is your Form

private void YourForm_Load(object sender, EventArgs e)  
{ 
    this.ActiveControl = null;       
}


标签: c# forms