Why do my Label.Text values disappear?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form with several labels on it that ae filled in through code but
for some reason the contents disappear. Does anyone have a guess as to what
might be happening?

Here is the part of the code where the problem occurs:

lblRunItem.Text = Item
txtCoilSpec.Text = CoilSpec
lblRunNo.Text = RunNo
lblOrdQty.Text = Qty
txtCore.Text = CGN
If CoreType = "I" Then

Single stepping thru the code and watching the "AUTO's" window I see the
lable contents being filled but when the code hits the "IF" test the contents
become an EMPTY STRING, why? The contents of all 3 labels disappear, the text
boxes are not impacted.

This code sets inside the KeyPress event of one of the text boxes on this
form. It makes no difference whether I add the "ME." on the front or not.
 
Are they actually disapearing from the form itself or do they 'Appear' to
disapear when you are debugging. You have to remember that Auto's will
disapear "From View" in the auto's window when they go out of close scope,
it's one of the characteristics of autos window.
 
They actually disappear from the form.

Terry Burns said:
Are they actually disapearing from the form itself or do they 'Appear' to
disapear when you are debugging. You have to remember that Auto's will
disapear "From View" in the auto's window when they go out of close scope,
it's one of the characteristics of autos window.
 
I found the problem. Turns out the "txtCore" has a "TextChanged" event that
causing the problem.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top