I am developing a winForm App in C# and I have come across something that has always bothered me.
Is it better practice to use a Label or a TextBox when displaying data to the user?
Things like Name, Phone #, etc. My gut says to use a TextBox and just set it to read-only until the time comes that I need to allow editing from that particular spot. Plan for the future, as it were.
As a young Lone Wolf developer I would really appreciate any insight here. Are there any pro’s and con’s to either? Is there something else I am not thinking of?
For data that the user can edit (whether it’s enabled in the current context or not) I always use a text box which I enable/disable as needed. For data that is purely informational, i.e. the user will not be given the option in the current context to change it, then that’s where I use a label.