Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Actually i have a textbox in winform i want focuz the control to that textbox in form load event i put the code txtPatient.Focus();,but actually it doesn't works.Please advise me...
private void frmSalesInvoiceUpdated_Load(object sender, EventArgs e)

{
txtPatient.Focus();
}.

What I have tried:

I tried with the tabindex value...
Posted
Updated 9-May-18 0:49am

1 solution

Instead of Focus, try Select:
C#
txtPatient.Select();
 
Share this answer
 
Comments
Bestin P S 9-May-18 7:05am    
Thomas D Yeah its works.Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900