0

Hi,

I created an application in C# winforms. Sometimes disabled textboxes in my application loose their value (i.e. they become empty valued). Has anyone evre encountered that same problem and has a solution to resolve it ?

Thanks in advance for you advice,

Alex.M

2
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by almuy
0

It sounds like the instance that the value is held in is being lost as you are somewhere along the line creating new instances of that thing and the values are lost.

If you could post some code it would help a lot to identify your specific problem.

0

Hi,

First of all thanks for your reply. I created my control in the design view so it's instantiated the first time the user control is being instantiated. Besides that, I never reinstantiate controls in code behind; I checked. For now, I tried setting the control readonly with a background color as if it was disabled in light grey. I don't know if this will solve this issue, but there goes a try. I don't understand more, it doesen't seem logic. It almost never happens, it sometimes happens randomly for apparently no reason, I can't find what causes it.

0

I have changed all disabled textboxes to readonly and the program works better ; specially when values in those textboxes are changed programmatically from code behind.

Regards,

Alex.M

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.