Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27208

VS 2010 How to make that Timer use only one repeat?

$
0
0
Hi, my english is poor because i'm spanish, sorry.

I need to make that a timer only use one repeat when i touch hotkey and stop.
For example, if I want that the timer1 write "CXZ" and stop. Actually Timer1 write: CXZCXZCXZCXZCXZ...

I try to put Timer2, that with other hotkey reload timer1, but finally timer1 and timer2 were broken.

My Code:

PHP Code:

    Private Sub Timer1_Tick(sender As System.ObjectAs System.EventArgsHandles Timer1.Tick 
        Dim hotkey 
As Boolean 
        hotkey 
GetAsyncKeyState(Keys.RControlKey
        If 
hotkey True Then 
            My
.Computer.Keyboard.SendKeys("CXZ"
            
My.Computer.Keyboard.SendKeys("{Enter}"
            
Timer1.Enabled False 
        End 
If 
    
End Sub 

    
Private Sub Timer2_Tick(sender As System.ObjectAs System.EventArgsHandles Timer2.Tick 
        Dim hotkay 
As Boolean 
        hotkay 
GetAsyncKeyState(Keys.Right
        If 
hotkay True Then 
            Timer1
.Enabled False 
            Timer1
.Enabled True 
        End 
If 
    
End Sub 

I want that timer1 only make one repeat and stop. Thanks :D
PD: Sorry for my english again ):

Viewing all articles
Browse latest Browse all 27208

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>