Shawn:
If I try this in VBA (don't have VB on this machine but as far as i know the function are the same)
1) Disabling the TextBox turns the text grey. It does not accept or respond to any mouse or keyboard input. Setting the ForeColor of the text doesn't help - its still grey.
- Same reponse as i get
2) Locking the TextBox just makes the TextBox read-only. It still "responds" to mouse clicks and keyboard input - just that you can't add or delete or change any of the contents.
- Same reponse as i get
3) Disabling AND locking the textbox makes the textbox read only without the grey, just like an label.
If needed contact me for an access example.
If I was needing something like a disabled textbox - but without the grey - I would tend to use a Label that looks like a textbox.
- I agree to the point that you could use a label, but that's not good for showing more text than the label can handle to the user.
Here's an sample of the VBA code that produces the function (taken from access):
code:
Private Sub Commando8_Click()
If Me.Text6.Enabled = True Then
Me.Text6.Enabled = False
Me.Commando8.Caption = "Disable"
Else
Me.Text6.Enabled = True
Me.Commando8.Caption = "Enable"
End If
End Sub
Private Sub Commando9_Click()
If Me.Text6.Locked = True Then
Me.Text6.Locked = False
Me.Commando9.Caption = "Lock"
Else
Me.Text6.Locked = True
Me.Kommando9.Caption = "UnLock"
End If
End Sub
This is an form using one textbox (Text6) and two commandbuttons (Command8 and Command9).
When pressing the different buttons the textbox cycles trough the different modes.
Borte