Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I want to alternatively change the value of textbox from 3 to 5 and vice varsa through c# code without using conditional operator , if else and Case .how can i do it plz reply me

thanx in advance.. :)
Posted
Comments
Sandeep Mewara 4-Aug-10 6:37am    
What have you tried so far? Where are you stuck?
koool.kabeer 4-Aug-10 16:46pm    
TextBox1.Value+=int.Parse(TextBox1.Value)+2;

1 solution

I'm not quite sure what you want to do but here is a suggestion.

You could make the 'new value' = 8 - 'old value'

ie
8 - 3 = 5
8 - 5 = 3

Hope that helps :)
 
Share this answer
 

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