Just use the key down event. Maybe something like this:Sub text1_KeyDown() MsgBox ("This is an error")End Sub
If you want to prevent anybody from entering data into the text box then you can just set the enabled property to false.HTHAlbert
Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
MsgBox "You can't do that!"KeyCode = 0 'To prevent the key from altering the text.End Sub
If Text1.Text <> OriginalText ThenMsgBox "You can't do that!"Text1.Text = OriginalTextEnd If
If you need to be able to scroll through the text and do have the "Locked" property:
Text1.Locked = True
If you need to be able to scroll through the text and don't have the "Locked" property and don't ever use the textbox to let people enter info:
You can download my ScrollLbl.ocx from my web page.
It has a caption limit of 28,000 bytes.It's not perfect, but it comes in handy.
It looks like you're new here. If you want to get involved, click one of these buttons!