C# disable textbox focus on form load

2020-05-09 22:25发布

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;

标签: c# forms
1条回答
叛逆
2楼-- · 2020-05-09 23:22

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

private void YourForm_Load(object sender, EventArgs e)  
{ 
    this.ActiveControl = null;       
}
查看更多
登录 后发表回答