Click here to Skip to main content
15,885,695 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all....
i have created more than 500 dynamic text boxes while using
C#
txtdynamic1.TabIndex = Convert.ToByte(integerinc + 1);


here integerinc is a integer variable it increase every time by one and Convert.ToByte method taking up to 252 integer value after that it move to produce an error like (Value was either too large or too small for an unsigned byte.) cause of byte it takes 0 to 255 values so how can i add tab index to remaining textboxes can any one please help me


thanks in advance......
Posted
Updated 3-Nov-11 0:01am
v2
Comments
tulasiram3975 3-Nov-11 6:16am    
Thank You.....( CodeHelper_PS)

i think cast with (short) is working......
 
Share this answer
 
Inseted of using...

C#
Convert.ToByte(integerinc + 1);


try this...
C#
Convert.ToInt(integerinc + 1);
 
Share this answer
 
Comments
tulasiram3975 3-Nov-11 6:33am    
yes i used this but am getting error like Cannot implicitly convert type 'int' to 'short'. An explicit conversion exists (are you missing a cast?)
tulasiram3975 3-Nov-11 7:06am    
i think cast with (short) is working......
thank you......

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