Click here to Skip to main content
15,895,709 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have the no. I1314006275 and a textbox in windows forms 2010, how i can set I1314 i.e the first five digits so that user don't have to type every time I1314 in textbox.
Posted
Updated 3-Oct-13 2:56am
v2
Comments
Richard MacCutchan 3-Oct-13 8:22am    
Something like: textbox1.Text = "I1314";
alanmaster 3-Oct-13 8:35am    
when the windows form load the first five digit should be I1314 and next six digit should be 000000 so that user can type for eg. 6275 number in last six digits i.e I1314006275
USER SHOULD NOT TYPE I1314(this is for year 2013-2014) every time the form loads.
Richard MacCutchan 3-Oct-13 8:51am    
So what is your problem?
alanmaster 3-Oct-13 9:54am    
My problen is how to modify a textbox so that when the windows form load the first five digit should be I1314 and next six digit should be 000000 so that user can type for eg. 6275 number in last six digits i.e I1314006275
USER SHOULD NOT TYPE I1314(this is for year 2013-2014) every time the form loads.
Richard MacCutchan 3-Oct-13 9:58am    
Well I have given you two samples of code to achieve this, so I repeat: "what is your problem"?

1 solution

C#
textBox.Text = "I1314000000";
textBox.Select(11,0);
 
Share this answer
 
Comments
Ammar4556257 4-Oct-13 6:55am    
what is (11, 0)
Richard MacCutchan 4-Oct-13 7:02am    
Ammar4556257 4-Oct-13 7:08am    
It looks like this line of code is to avoid the text selection in textbox.
Richard MacCutchan 4-Oct-13 7:32am    
Why not try it for yourself to see what happens, and see also how that relates to the above question?

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