Create a project and on the Form Draw a Frame (Frame1) set it's visible property to False and blank out its Caption. Inside the Frame draw a Label and set its Caption property to whatever message you want displayed. Set the KeyPreview property of the Form to True. Copy and paste the code below into the Declaration Section of the Form and run it
Note that the Mouse down and up only work on the area of the Form that has no controls on it. The Key down and up should work everywhere on the FormCode:Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) Frame1.Visible = True End Sub Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer) Frame1.Visible = False End Sub Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Frame1.Visible = True End Sub Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) Frame1.Visible = False End Sub




Reply With Quote