Here I want my no to limit in 4 digit like if it is 1 it should show as 0001,if it 11 it should show as 0011..Below are the code.
reciptno=1;//Pass only integer.
string formatted = string.Format("{0:0000}", reciptno);
TxtRecNo.Text = formatted;//Output=0001..
I implemented this code to generate Money receipt no.