我正在为 Windows Phone 开发一个应用程序。我的问题是如何在 2 秒后触发事件?
Private Sub btn1_Click(sender As Object, e As RoutedEventArgs) Handles btn1.Click
Dim input As String = txtinput.Text
Dim last As Char = input(input.Length - 1)
If last = "A" Then
Dim final As String = input.Substring(0, input.Length - 1) & "B"c
txtinput.Text = final.
'start timer here
'trigger an event after 2 seconds
ElseIf last = "B" Then
Dim final As String = input.Substring(0, input.Length - 1) & "C"c
Dim tmr As TimeSpan = TimeSpan.FromSeconds(2)
txtinput.Text = final
'start timer here
'trigger an event after 2 seconds
Else
txtinput.Text = input + "A"
End If
End Sub
我使用 Visual Basic 作为我的语言来开发它。任何帮助将非常感激。