Imports System.IO
Imports System.Windows.Forms
Public Class Form2
Private Sub Form2_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
If SerialPort1.IsOpen = False Then
MsgBox("ComPort Kapal! Bala Dmesi ile ComPortu Amalsnz?", MsgBoxStyle.Exclamation, "Uyar")
Exit Sub
Else
If e.KeyCode = Keys.Up Then
PictureBox1.Visible = True
PictureBox2.Visible = False
PictureBox3.Visible = False
PictureBox4.Visible = False
Label1.Text "8"
SerialPort1.Write(Label1.Text)
End If
If e.KeyCode = Keys.Right Then
PictureBox2.Visible = True
PictureBox1.Visible = False
PictureBox3.Visible = False
PictureBox4.Visible = False
Label1.Text = "6"
SerialPort1.Write(Label1.Text)
End If
If e.KeyCode = Keys.Down Then
PictureBox3.Visible = True
PictureBox1.Visible = False
PictureBox2.Visible = False
PictureBox4.Visible = False
Label1.Text = "2"
SerialPort1.Write(Label1.Text)
End If
If e.KeyCode = Keys.Left Then
PictureBox4.Visible = True
PictureBox1.Visible = False
PictureBox2.Visible = False
PictureBox3.Visible = False
Label1.Text = "4"
SerialPort1.Write(Label1.Text)
End If
End If
End Sub
End Class