Abnormal value assigned

Hi,

I have a label to hold the value of the Textbox, like

lb_var5.Text = tb_ite_from.Text;

Open in new window



Textbox is originally having the value of 5. But later on, when I retrieve the orginal value for Textbox, like

                                tb_ite_from.Text = lb_var5.Text;

Open in new window




I get 'bbbbbb' and I see no other coes to assign values to this Textbox. why does it happen?
LVL 12
HuaMin ChenProblem resolverAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Julian HansenCommented:
Have you done a search on your solution for the string 'bbbbbb'

What is triggering looking at the text value of the label? In other words - after you start the application is any input required before you run the code above.

What happens if you test the value immediately after setting it.

Have you stepped through your code with the debugger to see what is happening.

Can you post more of your code so we can get some idea of what is going on?
0
Jacques Bourgeois (James Burger)PresidentCommented:
Put some code with a breakpoint in the TextChanged events of both the TextBox and the Label. When you hit the breakpoint, check the value. If it is bbbbbb, then look at the Call Stack to see what triggered the event with that value.
0
HuaMin ChenProblem resolverAuthor Commented:
Sorry, I did not find out any place in which there is an assignment statement that is changing the value of lb_var5 other than the lines I showed above, within the project. I am afraid that I cannot directly run the project as within the project, there is a call to execute one other deployed project.
0
Jacques Bourgeois (James Burger)PresidentCommented:
Looking at the code is never sufficient, because things can be changed indirectly or through code that does not show directly the bbbbb. It could be hidden in a Sendkeys or a Chr call for instance. Or it could be changed by your "other deployed project".

The only way to really know what is happening is by trapping the event(s) that could lead you to what is happening just before the point at which the bad value appears in the control.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.