Prevent user from changing text box on Windows Form
I have a windows form project that depending on the user i need to make certain text boxes read only. I have tried using the following but it does not seem to have an effect and does not make it read only.
Which version? In certain versions you can me.txtbox.locked = true, but you can't do that in 2010... or 2008, IIRC.
You can always use me.txtbox.enabled = false, the downside is you can't see it as well.
But Readonly is the acceptable property, when I double checked it, the help text says "Controls whether the text in the edit control can be changed or not." Sounds pretty definitive.
Finally, you just don't update those fields when you hit save.
Readonly() prevents changes to the TextBox, but the user can still interact with the control. The cursor changes and the user can select text and even copy it...
I have used infragistics... unless it has improved, it is an overweight pig with some serious issues. I used it with .NET 2005... pretty, yes, reasonably functional, but the actual implementation leaves a lot to be desired. Oh, and it's REALLY expensive.
Ess Kay
Its been heavily improved, now its a colossal pig, but they update it at least twice a year, so the bugs are gone
Andy Bogus
Thank God the bugs are out... it made the product seriously unwieldy. Have they improved the performance of the various grids?
You can always use me.txtbox.enabled = false, the downside is you can't see it as well.
But Readonly is the acceptable property, when I double checked it, the help text says "Controls whether the text in the edit control can be changed or not." Sounds pretty definitive.
Finally, you just don't update those fields when you hit save.