I have a textbox on my login form that is unbound. I have set the MaxLength property to 20 characters in the designer. However, whenever I run the app, the MaxLength property seems to get reset to zero. I can tell this because I put a breakpoint in the Validating event and checked it. This only seems to happen on unbound textboxes. Bound textboxes seem to hold the property just fine. If I set the property in code, it works fine. Any idea why this would be happening?
When you say TextBox, do you mean UltraTextEditor? If you are using an actual TextBox, I'm afraid that's a little but outside the scope of these forums. You would probably be better off and get more helpful responses on a Microsoft or other generl DotNet WinForms forum.
Either way, I can't see any reason why the MaxLength would get reset. I tested this out in a simple form and set the UltraTextEditor MaxLength to 20, then checked in the Validating event and it works fine for me.
Can you duplicate this in a small sample project?
What version of the control are you using?