Not Focus in TextBox
I have a textbox and i want when my form load textbox dosen't have focus how i can do it?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Master BillaRank #2,229 · 630 reputationPosted Aug 16, 2009, 6:09 PM EDT
I hope you are doing in windows form application, then you need to do like this way
private void Form1_Load(object sender, EventArgs e)
{
txtName.Focus();
}
Maharaje124 reputationPosted Aug 16, 2009, 7:51 PM EDT
i can't change my control because i have to use TextBox the user is going to type in it BUT i don't want none of my TextBoxes have focus
How I can do it?
Maharaje124 reputationPosted Aug 17, 2009, 4:58 AM EDT
i'm sorry i was sleepy and didn't understand you very good
you are right
Master BillaRank #2,229 · 630 reputationPosted Aug 17, 2009, 9:26 AM EDT
You can do in easier way
private void Form1_Load(object sender, EventArgs e)
{
this.Focus();
}
thank you
Maharaje124 reputationPosted Aug 17, 2009, 5:26 PM EDT
Thank you