1 Replies - 442 Views - Last Post: 28 August 2017 - 12:15 AM Rate Topic: -----

#1 Mohammed.hasan96  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 27-August 17

Stop timer use space

Posted 27 August 2017 - 04:13 PM

Hi guys .. i have written a small code in vb6 . In the form there are 1-buttun 2-timer 3- label 4-text box .
When i start write on the text box the timer start count , how can i make the timer stop when i click space key in the text box ?
Is This A Good Question/Topic? 0
  • +

Replies To: Stop timer use space

#2 gibra  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 18-June 17

Re: Stop timer use space

Posted 28 August 2017 - 12:15 AM

You can use KeyPress event for check the key pressed:

Private Sub Text1_KeyPress(KeyAscii As Integer)
    If KeyAscii = 32 Then
        'Debug.Print "Space"
        Timer1.Enabled = False
    End If
End Sub

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1