Imports System.Runtime.InteropServices Public Class MainForm Private Shared Function GetAsyncKeyState(ByVal vKey As Integer) As Short End Function Private Sub MainForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load TmrDetect.Enabled = True End Sub Private Sub TmrDetect_Tick(sender As Object, e As EventArgs) Handles TmrDetect.Tick Try If GetAsyncKeyState(Keys.F3) <> 0 Then pbF3.BackColor = Color.Red pbF9.BackColor = Color.Transparent Me.Visible = False ElseIf GetAsyncKeyState(Keys.F9) <> 0 Then pbF3.BackColor = Color.Transparent pbF9.BackColor = Color.Red Me.Visible = True End If Catch ex As Exception End Try End Sub End Class