oralb5
08-03-2004, 01:54 PM
I have some textboxes which I made read-only, however can be populated using the calendar control. The point is that i don't want the end users to type in the wrong date by accident but rather use the calendar control.
While I was looking at it, I wondered if a user wanted to delete what he entered, could he since it is read-only?
Any ideas?
bear24rw
08-03-2004, 07:37 PM
do you want to clear the whole textbox?
if thats so then you could, under the textboxs Key down event, check if the user clicked the delete key
Private Sub txtName_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtName.KeyDown
If e.KeyCode = Keys.Delete Then
txtbox.Text = Nothing
End If
End Sub
Is that what you mean, or do you have multipul dates in one textbox and you only want to delete the last one entered?
hmmm... it doesnt seemt o work with the delete key but it works with others, can anyone explain this?
oh, delete is for the DEL key not the backspace :chuckle: anyways just change it to 'back' instead
oralb5
08-04-2004, 10:21 AM
This is exactly what I was asking about. Thanks.