改成
If e.sender.name="textbox1" AndAlso e.KeyCode = Keys.Enter Then e.Sender.text="" e.Cancel=TrueEnd If