|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
I have a few textboxes that I need to set locked and greyed out and I need to also be able to change that with a command button. So what I need is for the user to see the information but not be able to change it. when the add button is clicked the user needs to be able to enter the information. Then when the update button is clicked it needs to lock the information back and grey it out. Is this possible to do. I am not sure how to code this. If anyone could show me how to do this with code it would be very helpful.
Let me thank you in advance for any help. |
|
#2
|
||||
|
||||
|
Code:
Private Sub addButton_Click()
Me.txtSomeField.Enabled=True
End Sub
Private Sub updateButton_Click()
Me.txtSomeField.Enabled=False
End Sub
|
|
#3
|
|||
|
|||
|
Will this also grey them out as well
|
|
#4
|
||||
|
||||
|
The text in it will be greyed out. If you want to have the field itself greyed out then you will have to set the backcolor property also.
i.e. Code:
Private Sub addButton_Click()
Me.txtSomeField.Enabled=True
Me.txtSomeField.BackColor=vbWhite
End Sub
Private Sub updateButton_Click()
Me.txtSomeField.Enabled=False
Me.txtSomeField.BackColor=RGB(200,200,200)
End Sub
|
|
#5
|
|||
|
|||
|
Thank you for your help.
|
|
#6
|
||||
|
||||
|
Not a problem
|
|
#7
|
|||
|
|||
|
I need one more thing is there a way to keep the text black and not grey so it can be read
|
|
#8
|
||||
|
||||
|
Just adjust the background color so that the grey is lighter
i.e. something like RGB(225, 225, 225) You can also set the text to bold. Last edited by Onslaught : June 27th, 2003 at 11:48 AM. |
|
#9
|
|||
|
|||
|
I guess when you set the enable fuction to false It greys the text to. So I will play with it and see if I can make it where it will be viewable. Thanks again for your help. One more thing where can I find the Color skeem numbers.
|
|
#10
|
||||
|
||||
|
here is something that I found through google
http://www.hypersolutions.org/pages/rgbdec.html |
|
#11
|
|||
|
|||
|
Thank You for spending the time.
|
|
#12
|
||||
|
||||
|
Your welcome
|
|
#13
|
|||
|
|||
|
You can also also set the text box to be read/only via an api. this then allows them to cut/copy from it without disabling. Let me know if you would like the code.
|
|
#14
|
|||
|
|||
|
That would be cool I would like for the user to be able to do that.
|
|
#15
|
|||
|
|||
|
ok, here's the code although I just realized that it has been superseded by the .locked property, we must still have this remnant from older versions of VB. It still won't grey the text you'll have to do that manually.
PHP Code:
|