Textbox - set the locked property to true
Listbox - don't really need to do anything as nothing can be added to it without code
Date Picker - same thing
Combo box - set the locked property to true
Textbox - set the locked property to true
Listbox - don't really need to do anything as nothing can be added to it without code
Date Picker - same thing
Combo box - set the locked property to true
i dont even want the text to be highlighted :S i tried using locked property before but it still highlights the text.
if you want to stop the contents of highlighting, set the enabled property to False. I think that since DISABLED state is let's say Windows default you may have to let it go. I had a similar problem, and unless you have all the time in the word to code each field separately and to debug it afterwards: get on with the forecolor :P
if you want to stop the contents of highlighting, set the enabled property to False.
He doesn't want to do that.
Typically, I when I need something like this, I will put the code in each individual textbox. It is more effort on my part, but the users (and they are the ones that count) like it.
It doesn't worth the effort if you ask me. It is good to follow the user's wishes, but this may lead you to a terrible chaos.
Right now I am stuck alone in an enormous ERP-like project because I tried to ensure that all user wishes will be completed. DO NOT MAKE MY MISTAKE.
User must be tolerated to optimize the application GUI, maybe the application performance, but it must be clear for "IT" that is you who takes the decisions.
Why have a textbox that's Read Only? If you want something that's read-only, then use a label instead of a textbox.
You can make the label look just like a textbox with borders, colors, and so on.
The only difference in your code then is: Label1.Caption = "something" instead of Textbox1.Text = "something".
If you want the user to be able to change it after clicking the edit button, then you could to something like this:
Make a regular textbox. Then create a label directly on top of the textbox, exactly the same size and look. Have your program write to both the label and the textbox. Have the textbox visible property set to false, and the label visible property set to true.
When the user clicks the edit button, have the label visible property go to false, and the textbox property go to true.
This will do what you want.
Edited: Add attachment: Form
Last edited by Caskbill; Jan 30th, 2008 at 11:05 AM.