Link to home
Start Free TrialLog in
Avatar of isnoend2001
isnoend2001Flag for United States of America

asked on

Can a textbox be made to not allow pasting into. vb6

I have a vb6 textbox for dates and want to restrict pasting into. Can this be done ?
if yes how? other than clearing the clipboard
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Yes but why are you using a textbox if the user can't paste into it? Is typing into it OK?
ASKER CERTIFIED SOLUTION
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of isnoend2001

ASKER

The textbox is for dates that are used as the filename and have to be in a certain format eg
FileName = "mm-dd-yyyy" & ".rtf"
What does that have to do with pasting?

If you are afraid someone might paste in a wrongly formatted value, why not just add data validation?
Thanks that will work
You're welcome. Please be aware that my code in the MouseDown event prevents pasting by clearing the clipboard.