Imports System Imports System.Collections Imports System.Text Public Class Form1 Inherits System.Windows.Forms.Form Friend WithEvents MenuItem1 As System.Windows.Forms.MenuItem Friend WithEvents MenuItem2 As System.Windows.Forms.MenuItem Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu
#Region " Windows 窗体设计器生成的代码 "
Public Sub New() MyBase.New()
InitializeComponent()
End Sub
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) MyBase.Dispose(disposing) End Sub
Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents Panel1 As System.Windows.Forms.Panel Friend WithEvents rbLED As System.Windows.Forms.RadioButton Friend WithEvents rbOn As System.Windows.Forms.RadioButton Friend WithEvents rbOff As System.Windows.Forms.RadioButton Friend WithEvents rbBlink As System.Windows.Forms.RadioButton Private Sub InitializeComponent() Me.MainMenu1 = New System.Windows.Forms.MainMenu Me.MenuItem1 = New System.Windows.Forms.MenuItem Me.MenuItem2 = New System.Windows.Forms.MenuItem Me.rbLED = New System.Windows.Forms.RadioButton Me.Label1 = New System.Windows.Forms.Label Me.Label2 = New System.Windows.Forms.Label Me.Panel1 = New System.Windows.Forms.Panel Me.rbOn = New System.Windows.Forms.RadioButton Me.rbOff = New System.Windows.Forms.RadioButton Me.rbBlink = New System.Windows.Forms.RadioButton
Me.MainMenu1.MenuItems.Add(Me.MenuItem1)
Me.MenuItem1.MenuItems.Add(Me.MenuItem2) Me.MenuItem1.Text = "菜单"
Me.MenuItem2.Text = "退出"
Me.rbLED.Checked = True Me.rbLED.Location = New System.Drawing.Point(24, 48) Me.rbLED.Size = New System.Drawing.Size(60, 16) Me.rbLED.Text = "0"
Me.Label1.Location = New System.Drawing.Point(12, 24) Me.Label1.Size = New System.Drawing.Size(80, 16) Me.Label1.Text = "LED No."
Me.Label2.Location = New System.Drawing.Point(120, 24) Me.Label2.Size = New System.Drawing.Size(80, 16) Me.Label2.Text = "LED Status"
Me.Panel1.Controls.Add(Me.rbOn) Me.Panel1.Controls.Add(Me.rbOff) Me.Panel1.Controls.Add(Me.rbBlink) Me.Panel1.Location = New System.Drawing.Point(136, 48) Me.Panel1.Size = New System.Drawing.Size(76, 96)
Me.rbOn.Location = New System.Drawing.Point(6, 36) Me.rbOn.Size = New System.Drawing.Size(38, 20) Me.rbOn.Text = "On"
Me.rbOff.Checked = True Me.rbOff.Location = New System.Drawing.Point(6, 8) Me.rbOff.Size = New System.Drawing.Size(38, 20) Me.rbOff.Text = "Off"
Me.rbBlink.Location = New System.Drawing.Point(8, 64) Me.rbBlink.Size = New System.Drawing.Size(52, 20) Me.rbBlink.Text = "Blink"
Me.ClientSize = New System.Drawing.Size(234, 270) Me.Controls.Add(Me.Panel1) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Label1) Me.Controls.Add(Me.rbLED) Me.Text = "PPC LED Demo"
End Sub
#End Region
Public LED As New LED
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Me.Text = LED.GetLedCount() End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Dim wLed As Integer = CInt(InputBox("Led", , "0")) Dim wStatus As Integer = CInt(InputBox("Status", , "1")) LED.SetLedStatus(wLed, wStatus) End Sub
Private Sub rbOff_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbOff.CheckedChanged LED.SetLedStatus(0, LED.Status.OFF) End Sub
Private Sub rbOn_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbOn.CheckedChanged LED.SetLedStatus(0, LED.Status.ON) End Sub
Private Sub rbBlink_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles rbBlink.CheckedChanged LED.SetLedStatus(0, LED.Status.BLINK) End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub End Class
|