050615 B-A-M v1.0源代码

Posted on 2005-06-15 14:36  岳洋  阅读(466)  评论(0)    收藏  举报

form1:
Public Class Form1
    Inherits System.Windows.Forms.Form
#Region "变量声明"
    Public MedicineMaxiumNumber As Integer = 10
    Public BacteriaMaxiumNumber As Integer = 1000
    Public CurrentMedicine As Short
    Public med() As medicine
    Public bact() As bacteria
    Public i, j, k, l, sum As Short
    Public DropMedicineCounter As Integer = 0
    Public ReduceCounter As Integer = 0
    Public t As New bacteria()
    Public boi, boj As Boolean
    Public lastbact As Integer
    Public BacteriumAntiMedicineRate As Byte = 50
    Public ReproduceRate As Byte = 70
    Dim ro As System.Random = New Random()
    Public MedArray As ArrayList
    Public tempstring As String
#End Region

#Region " Windows 窗体设计器生成的代码 "

    Public Sub New()
        MyBase.New()

        '该调用是 Windows 窗体设计器所必需的。
        InitializeComponent()

        '在 InitializeComponent() 调用之后添加任何初始化

    End Sub

    '窗体重写处置以清理组件列表。
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Windows 窗体设计器所必需的
    Private components As System.ComponentModel.IContainer

    '注意:以下过程是 Windows 窗体设计器所必需的
    '可以使用 Windows 窗体设计器修改此过程。
    '不要使用代码编辑器修改它。
    Friend WithEvents Timer1 As System.Windows.Forms.Timer
    Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
    Friend WithEvents Button2 As System.Windows.Forms.Button
    Friend WithEvents Label17 As System.Windows.Forms.Label
    Friend WithEvents Label18 As System.Windows.Forms.Label
    Friend WithEvents Button3 As System.Windows.Forms.Button
    Friend WithEvents Label19 As System.Windows.Forms.Label
    Friend WithEvents Label20 As System.Windows.Forms.Label
    Friend WithEvents Label21 As System.Windows.Forms.Label
    Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
    Friend WithEvents TextBox3 As System.Windows.Forms.TextBox
    Friend WithEvents TextBox4 As System.Windows.Forms.TextBox
    Friend WithEvents Label22 As System.Windows.Forms.Label
    Friend WithEvents Button4 As System.Windows.Forms.Button
    Friend WithEvents Button5 As System.Windows.Forms.Button
    Friend WithEvents StartButton As System.Windows.Forms.Button
    Friend WithEvents PauseButton As System.Windows.Forms.Button
    Friend WithEvents label23 As System.Windows.Forms.Label
    Friend WithEvents TextBox5 As System.Windows.Forms.TextBox
    Friend WithEvents Button1 As System.Windows.Forms.Button
    Friend label(16) As System.Windows.Forms.Label
    Friend WithEvents ComboBox1 As System.Windows.Forms.ComboBox
    Friend WithEvents MedicineSitulation As System.Windows.Forms.Button
    Friend WithEvents TempTimer As System.Windows.Forms.Timer
    Friend WithEvents BacteriaSituation As System.Windows.Forms.Button
    Friend WithEvents ModelGroupBox As System.Windows.Forms.GroupBox
    Friend WithEvents SilentRadioButton As System.Windows.Forms.RadioButton
    Friend WithEvents ActiveRadioButton As System.Windows.Forms.RadioButton
    Friend WithEvents MedicineTimer As System.Windows.Forms.Timer
    Friend WithEvents BacteriaTimer As System.Windows.Forms.Timer
    Friend WithEvents ActiveGroupbox As System.Windows.Forms.GroupBox
    Friend WithEvents MedicineGroupBox As System.Windows.Forms.GroupBox
    Friend WithEvents BacteriaGroupBox As System.Windows.Forms.GroupBox
    Friend WithEvents MedicineCheckBox As System.Windows.Forms.CheckBox
    Friend WithEvents BacteriaCheckBox As System.Windows.Forms.CheckBox
    Friend WithEvents ReproduceSpeedComboBox As System.Windows.Forms.ComboBox
    Friend WithEvents ClearButton As System.Windows.Forms.Button
    Friend WithEvents BacteriaReproduceSpeedLabel As System.Windows.Forms.Label
    Friend WithEvents DropMedicineSpeedComboBox As System.Windows.Forms.ComboBox
    Friend WithEvents DropMedicineSpeedLabel As System.Windows.Forms.Label
    Friend WithEvents ReproduceRateLabel As System.Windows.Forms.Label
    Friend WithEvents ReproduceRateTextbox As System.Windows.Forms.TextBox
    Friend WithEvents ReproduceRateAcceptButton As System.Windows.Forms.Button
    Friend WithEvents AliveLabel As System.Windows.Forms.Label
    Friend WithEvents AliveDisplayLabel As System.Windows.Forms.Label
    Friend WithEvents SummaryButton As System.Windows.Forms.Button
    Friend WithEvents RefleshMapButton As System.Windows.Forms.Button
    Friend WithEvents AboutButton As System.Windows.Forms.Button

    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container()
        Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
        Me.GroupBox1 = New System.Windows.Forms.GroupBox()
        Me.ComboBox1 = New System.Windows.Forms.ComboBox()
        Me.Button5 = New System.Windows.Forms.Button()
        Me.TextBox2 = New System.Windows.Forms.TextBox()
        Me.Label21 = New System.Windows.Forms.Label()
        Me.Label20 = New System.Windows.Forms.Label()
        Me.Label19 = New System.Windows.Forms.Label()
        Me.Button3 = New System.Windows.Forms.Button()
        Me.TextBox3 = New System.Windows.Forms.TextBox()
        Me.TextBox4 = New System.Windows.Forms.TextBox()
        Me.Button4 = New System.Windows.Forms.Button()
        Me.StartButton = New System.Windows.Forms.Button()
        Me.PauseButton = New System.Windows.Forms.Button()
        Me.Button2 = New System.Windows.Forms.Button()
        Me.Label17 = New System.Windows.Forms.Label()
        Me.Label18 = New System.Windows.Forms.Label()
        Me.Label22 = New System.Windows.Forms.Label()
        Me.label23 = New System.Windows.Forms.Label()
        Me.TextBox5 = New System.Windows.Forms.TextBox()
        Me.Button1 = New System.Windows.Forms.Button()
        Me.MedicineSitulation = New System.Windows.Forms.Button()
        Me.TempTimer = New System.Windows.Forms.Timer(Me.components)
        Me.BacteriaSituation = New System.Windows.Forms.Button()
        Me.ModelGroupBox = New System.Windows.Forms.GroupBox()
        Me.ActiveRadioButton = New System.Windows.Forms.RadioButton()
        Me.SilentRadioButton = New System.Windows.Forms.RadioButton()
        Me.MedicineTimer = New System.Windows.Forms.Timer(Me.components)
        Me.BacteriaTimer = New System.Windows.Forms.Timer(Me.components)
        Me.ActiveGroupbox = New System.Windows.Forms.GroupBox()
        Me.BacteriaGroupBox = New System.Windows.Forms.GroupBox()
        Me.ReproduceRateAcceptButton = New System.Windows.Forms.Button()
        Me.ReproduceRateTextbox = New System.Windows.Forms.TextBox()
        Me.ReproduceRateLabel = New System.Windows.Forms.Label()
        Me.ReproduceSpeedComboBox = New System.Windows.Forms.ComboBox()
        Me.BacteriaReproduceSpeedLabel = New System.Windows.Forms.Label()
        Me.BacteriaCheckBox = New System.Windows.Forms.CheckBox()
        Me.MedicineGroupBox = New System.Windows.Forms.GroupBox()
        Me.MedicineCheckBox = New System.Windows.Forms.CheckBox()
        Me.DropMedicineSpeedComboBox = New System.Windows.Forms.ComboBox()
        Me.DropMedicineSpeedLabel = New System.Windows.Forms.Label()
        Me.ClearButton = New System.Windows.Forms.Button()
        Me.AliveLabel = New System.Windows.Forms.Label()
        Me.AliveDisplayLabel = New System.Windows.Forms.Label()
        Me.SummaryButton = New System.Windows.Forms.Button()
        Me.RefleshMapButton = New System.Windows.Forms.Button()
        Me.AboutButton = New System.Windows.Forms.Button()
        Me.GroupBox1.SuspendLayout()
        Me.ModelGroupBox.SuspendLayout()
        Me.ActiveGroupbox.SuspendLayout()
        Me.BacteriaGroupBox.SuspendLayout()
        Me.MedicineGroupBox.SuspendLayout()
        Me.SuspendLayout()
        '
        'Timer1
        '
        Me.Timer1.Interval = 20
        '
        'GroupBox1
        '
        Me.GroupBox1.Controls.AddRange(New System.Windows.Forms.Control() {Me.ComboBox1, Me.Button5, Me.TextBox2, Me.Label21, Me.Label20, Me.Label19, Me.Button3, Me.TextBox3, Me.TextBox4, Me.Button4})
        Me.GroupBox1.Location = New System.Drawing.Point(8, 8)
        Me.GroupBox1.Name = "GroupBox1"
        Me.GroupBox1.Size = New System.Drawing.Size(456, 120)
        Me.GroupBox1.TabIndex = 0
        Me.GroupBox1.TabStop = False
        Me.GroupBox1.Text = "抗生素"
        '
        'ComboBox1
        '
        Me.ComboBox1.Location = New System.Drawing.Point(8, 24)
        Me.ComboBox1.Name = "ComboBox1"
        Me.ComboBox1.Size = New System.Drawing.Size(80, 20)
        Me.ComboBox1.TabIndex = 9
        '
        'Button5
        '
        Me.Button5.Location = New System.Drawing.Point(376, 24)
        Me.Button5.Name = "Button5"
        Me.Button5.TabIndex = 8
        Me.Button5.Text = "Accept"
        '
        'TextBox2
        '
        Me.TextBox2.Enabled = False
        Me.TextBox2.Location = New System.Drawing.Point(200, 24)
        Me.TextBox2.Name = "TextBox2"
        Me.TextBox2.Size = New System.Drawing.Size(56, 21)
        Me.TextBox2.TabIndex = 5
        Me.TextBox2.Text = ""
        '
        'Label21
        '
        Me.Label21.Location = New System.Drawing.Point(8, 56)
        Me.Label21.Name = "Label21"
        Me.Label21.Size = New System.Drawing.Size(96, 24)
        Me.Label21.TabIndex = 4
        Me.Label21.Text = "anti-it-number"
        '
        'Label20
        '
        Me.Label20.Location = New System.Drawing.Point(256, 24)
        Me.Label20.Name = "Label20"
        Me.Label20.Size = New System.Drawing.Size(56, 24)
        Me.Label20.TabIndex = 3
        Me.Label20.Text = "killrate"
        '
        'Label19
        '
        Me.Label19.Location = New System.Drawing.Point(160, 24)
        Me.Label19.Name = "Label19"
        Me.Label19.Size = New System.Drawing.Size(40, 24)
        Me.Label19.TabIndex = 2
        Me.Label19.Text = "area"
        '
        'Button3
        '
        Me.Button3.Location = New System.Drawing.Point(88, 24)
        Me.Button3.Name = "Button3"
        Me.Button3.Size = New System.Drawing.Size(64, 24)
        Me.Button3.TabIndex = 1
        Me.Button3.Text = "Refresh"
        '
        'TextBox3
        '
        Me.TextBox3.Location = New System.Drawing.Point(312, 24)
        Me.TextBox3.Name = "TextBox3"
        Me.TextBox3.Size = New System.Drawing.Size(56, 21)
        Me.TextBox3.TabIndex = 5
        Me.TextBox3.Text = ""
        '
        'TextBox4
        '
        Me.TextBox4.Location = New System.Drawing.Point(104, 56)
        Me.TextBox4.Name = "TextBox4"
        Me.TextBox4.Size = New System.Drawing.Size(56, 21)
        Me.TextBox4.TabIndex = 5
        Me.TextBox4.Text = ""
        '
        'Button4
        '
        Me.Button4.Location = New System.Drawing.Point(168, 56)
        Me.Button4.Name = "Button4"
        Me.Button4.Size = New System.Drawing.Size(80, 24)
        Me.Button4.TabIndex = 7
        Me.Button4.Text = "Drop Med."
        '
        'StartButton
        '
        Me.StartButton.Location = New System.Drawing.Point(384, 136)
        Me.StartButton.Name = "StartButton"
        Me.StartButton.Size = New System.Drawing.Size(80, 24)
        Me.StartButton.TabIndex = 2
        Me.StartButton.Text = "Start"
        '
        'PauseButton
        '
        Me.PauseButton.Location = New System.Drawing.Point(384, 136)
        Me.PauseButton.Name = "PauseButton"
        Me.PauseButton.Size = New System.Drawing.Size(80, 24)
        Me.PauseButton.TabIndex = 2
        Me.PauseButton.Text = "Pause"
        Me.PauseButton.Visible = False
        '
        'Button2
        '
        Me.Button2.Location = New System.Drawing.Point(384, 168)
        Me.Button2.Name = "Button2"
        Me.Button2.Size = New System.Drawing.Size(80, 24)
        Me.Button2.TabIndex = 3
        Me.Button2.Text = "Drop Bact."
        '
        'Label17
        '
        Me.Label17.Location = New System.Drawing.Point(192, 144)
        Me.Label17.Name = "Label17"
        Me.Label17.Size = New System.Drawing.Size(64, 24)
        Me.Label17.TabIndex = 4
        Me.Label17.Text = "lastbact"
        '
        'Label18
        '
        Me.Label18.Location = New System.Drawing.Point(264, 144)
        Me.Label18.Name = "Label18"
        Me.Label18.Size = New System.Drawing.Size(32, 32)
        Me.Label18.TabIndex = 5
        '
        'Label22
        '
        Me.Label22.Location = New System.Drawing.Point(304, 144)
        Me.Label22.Name = "Label22"
        Me.Label22.Size = New System.Drawing.Size(40, 24)
        Me.Label22.TabIndex = 6
        Me.Label22.Text = "Off"
        '
        'label23
        '
        Me.label23.Location = New System.Drawing.Point(192, 232)
        Me.label23.Name = "label23"
        Me.label23.Size = New System.Drawing.Size(64, 32)
        Me.label23.TabIndex = 7
        Me.label23.Text = "Bact.Anti-Med.rate"
        '
        'TextBox5
        '
        Me.TextBox5.Location = New System.Drawing.Point(256, 232)
        Me.TextBox5.Name = "TextBox5"
        Me.TextBox5.Size = New System.Drawing.Size(40, 21)
        Me.TextBox5.TabIndex = 8
        Me.TextBox5.Text = "50"
        '
        'Button1
        '
        Me.Button1.Location = New System.Drawing.Point(192, 264)
        Me.Button1.Name = "Button1"
        Me.Button1.Size = New System.Drawing.Size(96, 24)
        Me.Button1.TabIndex = 9
        Me.Button1.Text = "Accept"
        '
        'MedicineSitulation
        '
        Me.MedicineSitulation.Location = New System.Drawing.Point(384, 200)
        Me.MedicineSitulation.Name = "MedicineSitulation"
        Me.MedicineSitulation.Size = New System.Drawing.Size(80, 24)
        Me.MedicineSitulation.TabIndex = 10
        Me.MedicineSitulation.Text = "Med. Situ."
        '
        'TempTimer
        '
        Me.TempTimer.Interval = 20
        '
        'BacteriaSituation
        '
        Me.BacteriaSituation.Location = New System.Drawing.Point(384, 232)
        Me.BacteriaSituation.Name = "BacteriaSituation"
        Me.BacteriaSituation.Size = New System.Drawing.Size(80, 24)
        Me.BacteriaSituation.TabIndex = 11
        Me.BacteriaSituation.Text = "Bact.Situ."
        '
        'ModelGroupBox
        '
        Me.ModelGroupBox.Controls.AddRange(New System.Windows.Forms.Control() {Me.ActiveRadioButton, Me.SilentRadioButton})
        Me.ModelGroupBox.Location = New System.Drawing.Point(296, 224)
        Me.ModelGroupBox.Name = "ModelGroupBox"
        Me.ModelGroupBox.Size = New System.Drawing.Size(80, 64)
        Me.ModelGroupBox.TabIndex = 12
        Me.ModelGroupBox.TabStop = False
        Me.ModelGroupBox.Text = "模拟类型"
        '
        'ActiveRadioButton
        '
        Me.ActiveRadioButton.Location = New System.Drawing.Point(8, 32)
        Me.ActiveRadioButton.Name = "ActiveRadioButton"
        Me.ActiveRadioButton.Size = New System.Drawing.Size(64, 24)
        Me.ActiveRadioButton.TabIndex = 1
        Me.ActiveRadioButton.Text = "Active"
        '
        'SilentRadioButton
        '
        Me.SilentRadioButton.Checked = True
        Me.SilentRadioButton.Location = New System.Drawing.Point(8, 16)
        Me.SilentRadioButton.Name = "SilentRadioButton"
        Me.SilentRadioButton.Size = New System.Drawing.Size(64, 16)
        Me.SilentRadioButton.TabIndex = 0
        Me.SilentRadioButton.TabStop = True
        Me.SilentRadioButton.Text = "Silent"
        '
        'MedicineTimer
        '
        Me.MedicineTimer.Interval = 1000
        '
        'BacteriaTimer
        '
        Me.BacteriaTimer.Interval = 5000
        '
        'ActiveGroupbox
        '
        Me.ActiveGroupbox.Controls.AddRange(New System.Windows.Forms.Control() {Me.BacteriaGroupBox, Me.MedicineGroupBox})
        Me.ActiveGroupbox.Location = New System.Drawing.Point(496, 16)
        Me.ActiveGroupbox.Name = "ActiveGroupbox"
        Me.ActiveGroupbox.Size = New System.Drawing.Size(232, 304)
        Me.ActiveGroupbox.TabIndex = 13
        Me.ActiveGroupbox.TabStop = False
        Me.ActiveGroupbox.Text = "Active"
        '
        'BacteriaGroupBox
        '
        Me.BacteriaGroupBox.Controls.AddRange(New System.Windows.Forms.Control() {Me.ReproduceRateAcceptButton, Me.ReproduceRateTextbox, Me.ReproduceRateLabel, Me.ReproduceSpeedComboBox, Me.BacteriaReproduceSpeedLabel, Me.BacteriaCheckBox})
        Me.BacteriaGroupBox.Location = New System.Drawing.Point(8, 168)
        Me.BacteriaGroupBox.Name = "BacteriaGroupBox"
        Me.BacteriaGroupBox.Size = New System.Drawing.Size(216, 128)
        Me.BacteriaGroupBox.TabIndex = 1
        Me.BacteriaGroupBox.TabStop = False
        Me.BacteriaGroupBox.Text = "Bacteria"
        '
        'ReproduceRateAcceptButton
        '
        Me.ReproduceRateAcceptButton.Location = New System.Drawing.Point(144, 80)
        Me.ReproduceRateAcceptButton.Name = "ReproduceRateAcceptButton"
        Me.ReproduceRateAcceptButton.Size = New System.Drawing.Size(64, 24)
        Me.ReproduceRateAcceptButton.TabIndex = 5
        Me.ReproduceRateAcceptButton.Text = "Accept"
        '
        'ReproduceRateTextbox
        '
        Me.ReproduceRateTextbox.Location = New System.Drawing.Point(72, 80)
        Me.ReproduceRateTextbox.Name = "ReproduceRateTextbox"
        Me.ReproduceRateTextbox.Size = New System.Drawing.Size(64, 21)
        Me.ReproduceRateTextbox.TabIndex = 4
        Me.ReproduceRateTextbox.Text = "70"
        '
        'ReproduceRateLabel
        '
        Me.ReproduceRateLabel.Location = New System.Drawing.Point(8, 80)
        Me.ReproduceRateLabel.Name = "ReproduceRateLabel"
        Me.ReproduceRateLabel.Size = New System.Drawing.Size(64, 32)
        Me.ReproduceRateLabel.TabIndex = 3
        Me.ReproduceRateLabel.Text = "ReproduceRate"
        '
        'ReproduceSpeedComboBox
        '
        Me.ReproduceSpeedComboBox.Location = New System.Drawing.Point(72, 48)
        Me.ReproduceSpeedComboBox.Name = "ReproduceSpeedComboBox"
        Me.ReproduceSpeedComboBox.Size = New System.Drawing.Size(136, 20)
        Me.ReproduceSpeedComboBox.TabIndex = 2
        '
        'BacteriaReproduceSpeedLabel
        '
        Me.BacteriaReproduceSpeedLabel.Location = New System.Drawing.Point(8, 48)
        Me.BacteriaReproduceSpeedLabel.Name = "BacteriaReproduceSpeedLabel"
        Me.BacteriaReproduceSpeedLabel.Size = New System.Drawing.Size(64, 32)
        Me.BacteriaReproduceSpeedLabel.TabIndex = 1
        Me.BacteriaReproduceSpeedLabel.Text = "ReproduceSpeed"
        '
        'BacteriaCheckBox
        '
        Me.BacteriaCheckBox.Location = New System.Drawing.Point(8, 24)
        Me.BacteriaCheckBox.Name = "BacteriaCheckBox"
        Me.BacteriaCheckBox.Size = New System.Drawing.Size(72, 24)
        Me.BacteriaCheckBox.TabIndex = 0
        Me.BacteriaCheckBox.Text = "Enabled"
        '
        'MedicineGroupBox
        '
        Me.MedicineGroupBox.Controls.AddRange(New System.Windows.Forms.Control() {Me.MedicineCheckBox, Me.DropMedicineSpeedComboBox, Me.DropMedicineSpeedLabel})
        Me.MedicineGroupBox.Location = New System.Drawing.Point(8, 24)
        Me.MedicineGroupBox.Name = "MedicineGroupBox"
        Me.MedicineGroupBox.Size = New System.Drawing.Size(216, 136)
        Me.MedicineGroupBox.TabIndex = 0
        Me.MedicineGroupBox.TabStop = False
        Me.MedicineGroupBox.Text = "Medicine"
        '
        'MedicineCheckBox
        '
        Me.MedicineCheckBox.Location = New System.Drawing.Point(8, 24)
        Me.MedicineCheckBox.Name = "MedicineCheckBox"
        Me.MedicineCheckBox.Size = New System.Drawing.Size(72, 24)
        Me.MedicineCheckBox.TabIndex = 0
        Me.MedicineCheckBox.Text = "Enabled"
        '
        'DropMedicineSpeedComboBox
        '
        Me.DropMedicineSpeedComboBox.Location = New System.Drawing.Point(72, 48)
        Me.DropMedicineSpeedComboBox.Name = "DropMedicineSpeedComboBox"
        Me.DropMedicineSpeedComboBox.Size = New System.Drawing.Size(136, 20)
        Me.DropMedicineSpeedComboBox.TabIndex = 2
        '
        'DropMedicineSpeedLabel
        '
        Me.DropMedicineSpeedLabel.Location = New System.Drawing.Point(8, 48)
        Me.DropMedicineSpeedLabel.Name = "DropMedicineSpeedLabel"
        Me.DropMedicineSpeedLabel.Size = New System.Drawing.Size(64, 32)
        Me.DropMedicineSpeedLabel.TabIndex = 1
        Me.DropMedicineSpeedLabel.Text = "DropMedicineSpeed"
        '
        'ClearButton
        '
        Me.ClearButton.Location = New System.Drawing.Point(384, 296)
        Me.ClearButton.Name = "ClearButton"
        Me.ClearButton.Size = New System.Drawing.Size(80, 24)
        Me.ClearButton.TabIndex = 14
        Me.ClearButton.Text = "Clear"
        '
        'AliveLabel
        '
        Me.AliveLabel.Location = New System.Drawing.Point(192, 176)
        Me.AliveLabel.Name = "AliveLabel"
        Me.AliveLabel.Size = New System.Drawing.Size(48, 24)
        Me.AliveLabel.TabIndex = 15
        Me.AliveLabel.Text = "Alive"
        '
        'AliveDisplayLabel
        '
        Me.AliveDisplayLabel.Location = New System.Drawing.Point(264, 176)
        Me.AliveDisplayLabel.Name = "AliveDisplayLabel"
        Me.AliveDisplayLabel.Size = New System.Drawing.Size(32, 32)
        Me.AliveDisplayLabel.TabIndex = 16
        '
        'SummaryButton
        '
        Me.SummaryButton.Location = New System.Drawing.Point(384, 264)
        Me.SummaryButton.Name = "SummaryButton"
        Me.SummaryButton.Size = New System.Drawing.Size(80, 24)
        Me.SummaryButton.TabIndex = 17
        Me.SummaryButton.Text = "Summary"
        '
        'RefleshMapButton
        '
        Me.RefleshMapButton.Location = New System.Drawing.Point(192, 296)
        Me.RefleshMapButton.Name = "RefleshMapButton"
        Me.RefleshMapButton.Size = New System.Drawing.Size(96, 24)
        Me.RefleshMapButton.TabIndex = 18
        Me.RefleshMapButton.Text = "RefleshMap"
        '
        'AboutButton
        '
        Me.AboutButton.Location = New System.Drawing.Point(296, 296)
        Me.AboutButton.Name = "AboutButton"
        Me.AboutButton.Size = New System.Drawing.Size(80, 24)
        Me.AboutButton.TabIndex = 19
        Me.AboutButton.Text = "About"
        '
        'Form1
        '
        Me.AcceptButton = Me.StartButton
        Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
        Me.ClientSize = New System.Drawing.Size(480, 334)
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.AboutButton, Me.RefleshMapButton, Me.SummaryButton, Me.AliveDisplayLabel, Me.AliveLabel, Me.ClearButton, Me.ActiveGroupbox, Me.ModelGroupBox, Me.BacteriaSituation, Me.MedicineSitulation, Me.Button1, Me.TextBox5, Me.label23, Me.Label22, Me.Label18, Me.Label17, Me.Button2, Me.StartButton, Me.GroupBox1, Me.PauseButton})
        Me.MaximizeBox = False
        Me.Name = "Form1"
        Me.Text = "细菌抗药性模拟器 ver1.0"
        Me.GroupBox1.ResumeLayout(False)
        Me.ModelGroupBox.ResumeLayout(False)
        Me.ActiveGroupbox.ResumeLayout(False)
        Me.BacteriaGroupBox.ResumeLayout(False)
        Me.MedicineGroupBox.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub
#End Region
    Public Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ReDim med(MedicineMaxiumNumber - 1)
        ReDim bact(BacteriaMaxiumNumber - 1)
        For i = 0 To 15
            Me.label(i) = New System.Windows.Forms.Label()
            Me.label(i).Location = New System.Drawing.Point(32 + ((i) Mod 4) * 40, 144 + ((i) \ 4) * 40)
            Me.label(i).Name = "Label" & Str(i + 1)
            Me.label(i).Size = New System.Drawing.Size(32, 32)
            Me.label(i).Text = ""
            Me.Controls.Add(Me.label(i))
        Next

        For i = 0 To MedicineMaxiumNumber - 1
            med(i) = New medicine()
        Next
        For i = 0 To BacteriaMaxiumNumber - 1
            bact(i) = New bacteria()
            ReDim bact(i).antimedicine(10)
            For Each boi In bact(i).antimedicine
                boi = False
            Next
        Next
        For i = 0 To MedicineMaxiumNumber - 1
            ComboBox1.Items.Add("抗生素" & Str(i))
        Next
        CurrentMedicine = 0
        firstready()
    End Sub
#Region "Medicine"
    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        reflesh(sender, e)
    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        If Not (IsNumeric(TextBox2.Text)) Then
            MsgBox("Must be number!")
        Else
            If Int(Val(TextBox2.Text)) <> Val(TextBox2.Text) Then
                MsgBox("Must be integer!")
            Else
                If Val(TextBox2.Text) > 100 Or Val(TextBox2.Text) < 0 Then
                    MsgBox("Must be no more than 100 and no less than 0!")
                Else
                    med(CurrentMedicine).area = Val(TextBox2.Text)
                End If
            End If
        End If
        If Not (IsNumeric(TextBox3.Text)) Then
            MsgBox("Must be number!")
        Else
            If Int(Val(TextBox3.Text)) <> Val(TextBox3.Text) Then
                MsgBox("Must be integer!")
            Else
                If Val(TextBox3.Text) > 100 Or Val(TextBox3.Text) < 0 Then
                    MsgBox("Must be no more than 100 and no less than 0!")
                Else
                    med(CurrentMedicine).killrate = Val(TextBox3.Text)
                End If
            End If
        End If
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        DropMedicine(CurrentMedicine)
    End Sub
#End Region
#Region "Timer"
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        clearlabel()
        Label18.Text = Str(lastbact)
        sum = 0
        For i = 0 To BacteriaMaxiumNumber - 1
            If bact(i).alive = True Then
                printbact(i)
                boi = True
                For j = 0 To MedicineMaxiumNumber - 1
                    If bact(i).antimedicine(j) = False Then
                        boi = False
                        Exit For
                    End If
                Next
                If boi = True Then
                    Timer1.Stop()
                    Label22.Text = "Off"
                    StartButton.Visible = True
                    PauseButton.Visible = False
                    MsgBox("Super bacteria appeared!")
                    Exit Sub
                End If
                sum += 1
            End If
        Next
        If sum = 0 And lastbact <> 0 Then
            Timer1.Stop()
            Label22.Text = "Off"
            StartButton.Visible = True
            PauseButton.Visible = False
            MsgBox("All the bacterium died!")
            Exit Sub
        End If
        If lastbact = BacteriaMaxiumNumber And alive() <> lastbact Then
            MedicineTimer.Stop()
            BacteriaTimer.Stop()
            k = 0
            For i = 0 To BacteriaMaxiumNumber - 1
                If bact(i).alive Then
                    If i <> k Then
                        bact(k).alive = True
                        For j = 0 To MedicineMaxiumNumber - 1
                            bact(k).antimedicine(j) = bact(i).antimedicine(j)
                        Next
                        bact(k).locate.X = bact(i).locate.X
                        bact(k).locate.Y = bact(i).locate.Y
                        bact(i).alive = False
                    End If
                    k += 1
                End If
            Next
            lastbact = k
            If MedicineCheckBox.Checked Then MedicineTimer.Start()
            If BacteriaCheckBox.Checked Then BacteriaTimer.Start()
        End If
    End Sub
    Private Sub BacteriaTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BacteriaTimer.Tick
        ReduceCounter += 1
        If lastbact <> BacteriaMaxiumNumber Then
            If Timer1.Enabled = True Then
                sum = lastbact
                For i = 0 To sum - 1
                    If bact(i).alive = True And lastbact < BacteriaMaxiumNumber And rate(ReproduceRate) Then
                        lastbact = lastbact + 1
                        bact(lastbact - 1).alive = True
                        bact(lastbact - 1).locate.X = bact(i).locate.X + (ro.Next(1, 4) - 2)
                        bact(lastbact - 1).locate.Y = bact(i).locate.Y + (ro.Next(1, 4) - 2)
                        If bact(lastbact - 1).locate.X < 0 Then bact(lastbact - 1).locate.X += 4
                        If bact(lastbact - 1).locate.X > 3 Then bact(lastbact - 1).locate.X -= 4
                        If bact(lastbact - 1).locate.Y < 0 Then bact(lastbact - 1).locate.Y += 4
                        If bact(lastbact - 1).locate.Y > 3 Then bact(lastbact - 1).locate.Y -= 4
                        For j = 0 To MedicineMaxiumNumber - 1
                            bact(lastbact - 1).antimedicine(j) = bact(i).antimedicine(j)
                        Next
                    End If
                Next

                refleshmap()
            End If
        End If
    End Sub
    Private Sub MedicineTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MedicineTimer.Tick
        DropMedicineCounter += 1
        If Timer1.Enabled Then
            CurrentMedicine += 1
            If CurrentMedicine = MedicineMaxiumNumber Then
                CurrentMedicine = 0
            End If
            DropMedicine(CurrentMedicine)
        End If

    End Sub

#End Region
#Region "Active-Medicine"
    Private Sub MedicineCheckBox_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MedicineCheckBox.CheckedChanged
        If MedicineCheckBox.Checked = True Then
            DropMedicineSpeedComboBox.Items.Clear()
            DropMedicineSpeedComboBox.Items.Add("slowest*2[20000]")
            DropMedicineSpeedComboBox.Items.Add("slowest[10000]")
            DropMedicineSpeedComboBox.Items.Add("slower[8000]")
            DropMedicineSpeedComboBox.Items.Add("slow[6000]")
            DropMedicineSpeedComboBox.Items.Add("normal[5000]")
            DropMedicineSpeedComboBox.Items.Add("fast[4000]")
            DropMedicineSpeedComboBox.Items.Add("faster[3000]")
            DropMedicineSpeedComboBox.Items.Add("fastest[2000]")
            DropMedicineSpeedComboBox.Items.Add("fastest*2[1000]")
            DropMedicineSpeedComboBox.Items.Add("fastest*4[500]")
            DropMedicineSpeedComboBox.Items.Add("fastest*8[250]")
            DropMedicineSpeedComboBox.Items.Add("crazy[100]")
            MedicineTimer.Start()
        Else
            MedicineTimer.Stop()
        End If
    End Sub

    Private Sub DropMedicineSpeedComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DropMedicineSpeedComboBox.SelectedIndexChanged
        Select Case DropMedicineSpeedComboBox.SelectedIndex
            Case 0
                MedicineTimer.Interval = 20000
            Case 1
                MedicineTimer.Interval = 10000
            Case 2
                MedicineTimer.Interval = 8000
            Case 3
                MedicineTimer.Interval = 6000
            Case 4
                MedicineTimer.Interval = 5000
            Case 5
                MedicineTimer.Interval = 4000
            Case 6
                MedicineTimer.Interval = 3000
            Case 7
                MedicineTimer.Interval = 2000
            Case 8
                MedicineTimer.Interval = 1000
            Case 9
                MedicineTimer.Interval = 500
            Case 10
                MedicineTimer.Interval = 250
            Case 11
                MedicineTimer.Interval = 100
            Case Else
                MsgBox("Wrong Speed!")
                BacteriaTimer.Interval = 5000
        End Select
    End Sub
#End Region
#Region "Active-Bacteria"
    Private Sub ReproduceRateAcceptButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ReproduceRateAcceptButton.Click
        If Not (IsNumeric(ReproduceRateTextbox.Text)) Then
            MsgBox("Must be number!")
        Else
            If Int(Val(ReproduceRateTextbox.Text)) <> Val(ReproduceRateTextbox.Text) Then
                MsgBox("Must be integer!")
            Else
                If Val(ReproduceRateTextbox.Text) > 100 Or Val(ReproduceRateTextbox.Text) < 0 Then
                    MsgBox("Must be no more than 100 and no less than 0!")
                Else
                    ReproduceRate = Val(ReproduceRateTextbox.Text)
                End If
            End If
        End If
    End Sub
    Private Sub BacteriaCheckBox_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BacteriaCheckBox.CheckedChanged
        If BacteriaCheckBox.Checked = True Then
            ReproduceSpeedComboBox.Items.Clear()
            ReproduceSpeedComboBox.Items.Add("slowest*2[20000]")
            ReproduceSpeedComboBox.Items.Add("slowest[10000]")
            ReproduceSpeedComboBox.Items.Add("slower[8000]")
            ReproduceSpeedComboBox.Items.Add("slow[6000]")
            ReproduceSpeedComboBox.Items.Add("normal[5000]")
            ReproduceSpeedComboBox.Items.Add("fast[4000]")
            ReproduceSpeedComboBox.Items.Add("faster[3000]")
            ReproduceSpeedComboBox.Items.Add("fastest[2000]")
            ReproduceSpeedComboBox.Items.Add("fastest*2[1000]")
            ReproduceSpeedComboBox.Items.Add("fastest*4[500]")
            ReproduceSpeedComboBox.Items.Add("fastest*8[250]")
            ReproduceSpeedComboBox.Items.Add("crazy[100]")
            BacteriaTimer.Start()
        Else
            BacteriaTimer.Stop()
        End If
    End Sub

    Private Sub ReproduceSpeedComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ReproduceSpeedComboBox.SelectedIndexChanged
        Select Case ReproduceSpeedComboBox.SelectedIndex
            Case 0
                BacteriaTimer.Interval = 20000
            Case 1
                BacteriaTimer.Interval = 10000
            Case 2
                BacteriaTimer.Interval = 8000
            Case 3
                BacteriaTimer.Interval = 6000
            Case 4
                BacteriaTimer.Interval = 5000
            Case 5
                BacteriaTimer.Interval = 4000
            Case 6
                BacteriaTimer.Interval = 3000
            Case 7
                BacteriaTimer.Interval = 2000
            Case 8
                BacteriaTimer.Interval = 1000
            Case 9
                BacteriaTimer.Interval = 500
            Case 10
                BacteriaTimer.Interval = 250
            Case 11
                BacteriaTimer.Interval = 100
            Case Else
                MsgBox("Wrong Speed!")
                BacteriaTimer.Interval = 5000
        End Select
    End Sub
#End Region
#Region "Bottom"
    Private Sub StartButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StartButton.Click
        Timer1.Start()
        StartButton.Visible = False
        PauseButton.Visible = True
        Label22.Text = "On"
    End Sub
    Private Sub PauseButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PauseButton.Click
        Timer1.Stop()
        StartButton.Visible = True
        PauseButton.Visible = False
        Label22.Text = "Off"
    End Sub

 

 

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

        If lastbact = BacteriaMaxiumNumber Then
            MsgBox("maxium number of bacts!")
        Else
            lastbact = lastbact + 1
            newbact(lastbact - 1)
            refleshmap()
        End If
    End Sub

 

 

    Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If Not (IsNumeric(TextBox5.Text)) Then
            MsgBox("Must be number!")
        Else
            If Int(Val(TextBox5.Text)) <> Val(TextBox5.Text) Then
                MsgBox("Must be integer!")
            Else
                If Val(TextBox5.Text) > 100 Or Val(TextBox5.Text) < 0 Then
                    MsgBox("Must be no more than 100 and no less than 0!")
                Else
                    BacteriumAntiMedicineRate = Val(TextBox5.Text)
                End If
            End If
        End If
    End Sub

    Private Sub MedicineSitulation_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MedicineSitulation.Click
        Dim MedicineSitulationForm As Form2 = New Form2()
        MedicineSitulationForm.Owner = Me
        MedicineSitulationForm.Show()
        MedicineSitulationForm.Text = "Medicine Situlation(s)"
        MedicineSitulationForm.Situlation.Items.Add("抗生素编号" & "  " & "area" & "    " & "killrate" & "    " & "anti" & "        ")
        For i = 0 To MedicineMaxiumNumber - 1
            MedicineSitulationForm.Situlation.Items.Add(Str(i) & "          " & Str(med(i).area) & "       " & Str(med(i).killrate) & "        " & Str(antiitnumber(i, False)) & "        ")
        Next
    End Sub

    Private Sub BacteriaSituation_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BacteriaSituation.Click
        Dim BacteriaSitulationForm As Form2 = New Form2()
        BacteriaSitulationForm.Owner = Me
        BacteriaSitulationForm.Show()
        BacteriaSitulationForm.Text = "Bacteria Situlation(s)"
        BacteriaSitulationForm.Situlation.Items.Add("细菌编号" & "  " & "alive" & "    " & "locate" & " " & "anti" & "        ")
        For i = 0 To BacteriaMaxiumNumber - 1
            tempstring = Str(i) & Space(8 - Len(Str(i))) & Str(bact(i).alive) & Space(11 - Len(Str(bact(i).alive))) & Str(bact(i).locate.X) & "," & Str(bact(i).locate.Y) & Space(6 - Len(Str(bact(i).locate.X) & Str(bact(i).locate.Y)))
            For j = 0 To MedicineMaxiumNumber - 1
                If bact(i).antimedicine(j) Then
                    tempstring = tempstring + "1"
                Else
                    tempstring = tempstring + "0"
                End If
            Next
            BacteriaSitulationForm.Situlation.Items.Add(tempstring)
        Next
    End Sub
    Private Sub SummaryButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SummaryButton.Click
        Dim SummaryForm As Form2 = New Form2()
        SummaryForm.Owner = Me
        SummaryForm.Show()
        SummaryForm.Text = "Summary"
        SummaryForm.Situlation.Items.Add("被最多存活细菌免疫的抗生素:" & " " & "抗生素" & Str(MedicineMaxiumAntied(False)) & " " & Str(antiitnumber(MedicineMaxiumAntied(False), False)))
        SummaryForm.Situlation.Items.Add("被最多细菌免疫的抗生素:" & " " & "抗生素" & Str(MedicineMaxiumAntied(True)) & " " & Str(antiitnumber(MedicineMaxiumAntied(True), True)))
        If bacteriaMaxiumAnti(False) = -1 Then
            SummaryForm.Situlation.Items.Add("不存在存活一种免疫最多抗生素的细菌")
        Else
            k = bacteriaMaxiumAnti(False)
            sum = 0
            For j = 0 To MedicineMaxiumNumber - 1
                If bact(k).antimedicine(j) Then sum += 1
            Next
            SummaryForm.Situlation.Items.Add("存活免疫最多抗生素的细菌:" & " " & "细菌" & Str(k) & " " & Str(sum))
        End If
        If bacteriaMaxiumAnti(True) = -1 Then
            SummaryForm.Situlation.Items.Add("不存在一种免疫最多抗生素的细菌")
        Else
            k = bacteriaMaxiumAnti(True)
            sum = 0
            For j = 0 To MedicineMaxiumNumber - 1
                If bact(k).antimedicine(j) Then sum += 1
            Next
            SummaryForm.Situlation.Items.Add("免疫最多抗生素的细菌:" & " " & "细菌" & Str(k) & " " & Str(sum))
        End If
    End Sub

    Private Sub SilentRadioButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SilentRadioButton.Click
        MedicineTimer.Stop()
        BacteriaTimer.Stop()
        MedicineCheckBox.Checked = False
        BacteriaCheckBox.Checked = False
        Me.Width = 488
    End Sub

    Private Sub ActiveRadioButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ActiveRadioButton.Click
        Me.Width = 752
    End Sub

    Private Sub ClearButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ClearButton.Click
        lastbact = 0
        For i = 0 To BacteriaMaxiumNumber - 1
            bact(i).alive = False
            bact(i).locate = Nothing
            For j = 0 To MedicineMaxiumNumber - 1
                bact(i).antimedicine(j) = False
            Next
        Next
        refleshmap()
    End Sub

#End Region
#Region "公用方法"
    Private Sub firstready()
        clearlabel()
        lastbact = 0
    End Sub
    Private Sub newbact(ByVal number As Byte)
        bact(number).locate.X = (ro.Next(0, 4))
        bact(number).locate.Y = (ro.Next(0, 4))
        bact(number).alive = True
        For i = 0 To MedicineMaxiumNumber - 1
            bact(number).antimedicine(i) = False
        Next
    End Sub
    Private Sub printbact(ByVal i As Short)
        label(bact(i).locate.X * 4 + bact(i).locate.Y).Text = Val(label(bact(i).locate.X * 4 + bact(i).locate.Y).Text) + 1
    End Sub
    Private Sub clearlabel()
        For i = 0 To 15
            label(i).Text = "0"
        Next
    End Sub
    Private Sub refleshmap()
        clearlabel()
        Label18.Text = Str(lastbact)
        AliveDisplayLabel.Text = Str(alive())
        For i = 0 To BacteriaMaxiumNumber - 1
            If bact(i).alive = True Then
                printbact(i)
            End If
        Next
    End Sub
    Private Sub reflesh(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
        If ComboBox1.SelectedIndex <> -1 Then
            CurrentMedicine = ComboBox1.SelectedIndex
            printinfo(CurrentMedicine)
        Else
            MsgBox("Selected medicine do not exist!")
        End If
    End Sub

    Private Sub printinfo(ByVal i As Short)
        TextBox2.Text = med(CurrentMedicine).area
        TextBox3.Text = med(CurrentMedicine).killrate
        TextBox4.Text = antiitnumber(CurrentMedicine, False)
    End Sub
    Private Function antiitnumber(ByVal i As Byte, ByVal boi As Byte) As Int16
        sum = 0
        For j = 0 To BacteriaMaxiumNumber - 1
            If (bact(j).alive Or boi) And bact(j).antimedicine(i) = True Then sum += 1
        Next
        Return sum
    End Function
    Private Sub DropMedicine(ByVal j As Short)
        For i = 0 To BacteriaMaxiumNumber - 1
            If bact(i).alive Then
                If Not (bact(i).antimedicine(j)) Then '如果当前细菌对当前抗生素没有免疫力
                    If rate(med(j).killrate) Then
                        bact(i).alive = False '杀死该细菌
                    Else
                        If rate(BacteriumAntiMedicineRate) Then '给一定机会给该细菌对当前抗生素免疫
                            bact(i).antimedicine(j) = True
                        End If
                    End If
                End If
            End If
        Next
        refleshmap()
    End Sub
    Private Function rate(ByVal j As Byte) As Boolean
        If ro.Next(1, 100) <= j Then
            Return True
        Else
            Return False
        End If
    End Function
    Private Function alive() As Short
        Dim count As Short = 0
        For i = 0 To lastbact - 1
            If bact(i).alive Then count += 1
        Next
        Return count
    End Function
    Private Function MedicineMaxiumAntied(ByVal boi As Boolean) As Short
        Dim max As Short = 0
        For i = 0 To MedicineMaxiumNumber - 1
            If antiitnumber(i, boi) > antiitnumber(max, boi) Then max = i
        Next
        Return max
    End Function
    Private Function bacteriaMaxiumAnti(ByVal boi As Boolean) As Short
        Dim max As Short = 0
        Dim p As Short = -1
        Dim count As Short = 0
        For i = 0 To BacteriaMaxiumNumber - 1
            If bact(i).alive Or boi Then
                count = 0
                For j = 0 To MedicineMaxiumNumber - 1
                    If bact(i).antimedicine(j) Then count += 1
                Next
                If count > max Then
                    p = i
                    max = count
                End If
            End If
        Next
        Return p
    End Function
#End Region

    Private Sub RefleshMapButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RefleshMapButton.Click
        refleshmap()
    End Sub

    Private Sub AboutButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AboutButton.Click
        Dim newform3 As New Form3()
        newform3.Show()
    End Sub
End Class

form2:
Public Class Form2
    Inherits System.Windows.Forms.Form
    Public TempString1, TempString2 As String
    Public sum As Short

#Region " Windows 窗体设计器生成的代码 "

    Public Sub New()

        MyBase.New()

        '该调用是 Windows 窗体设计器所必需的。
        InitializeComponent()

        '在 InitializeComponent() 调用之后添加任何初始化

    End Sub

    '窗体重写处置以清理组件列表。
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Windows 窗体设计器所必需的
    Private components As System.ComponentModel.IContainer

    '注意:以下过程是 Windows 窗体设计器所必需的
    '可以使用 Windows 窗体设计器修改此过程。
    '不要使用代码编辑器修改它。
    Friend WithEvents OKButton As System.Windows.Forms.Button
    Friend WithEvents TempTimer As System.Windows.Forms.Timer
    Friend WithEvents Situlation As System.Windows.Forms.ListBox
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container()
        Me.Situlation = New System.Windows.Forms.ListBox()
        Me.OKButton = New System.Windows.Forms.Button()
        Me.TempTimer = New System.Windows.Forms.Timer(Me.components)
        Me.SuspendLayout()
        '
        'Situlation
        '
        Me.Situlation.ItemHeight = 12
        Me.Situlation.Location = New System.Drawing.Point(8, 8)
        Me.Situlation.Name = "Situlation"
        Me.Situlation.Size = New System.Drawing.Size(296, 280)
        Me.Situlation.TabIndex = 0
        '
        'OKButton
        '
        Me.OKButton.Location = New System.Drawing.Point(8, 296)
        Me.OKButton.Name = "OKButton"
        Me.OKButton.Size = New System.Drawing.Size(296, 56)
        Me.OKButton.TabIndex = 1
        '
        'TempTimer
        '
        Me.TempTimer.Enabled = True
        Me.TempTimer.Interval = 20
        '
        'Form2
        '
        Me.AcceptButton = Me.OKButton
        Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
        Me.ClientSize = New System.Drawing.Size(312, 358)
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.OKButton, Me.Situlation})
        Me.MaximizeBox = False
        Me.MinimizeBox = False
        Me.Name = "Form2"
        Me.Text = "Form2"
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub OKButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OKButton.Click
        Me.Dispose()
    End Sub

    Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        OKButton.Text = "OK"
        'TempTimer.Start()
    End Sub
End Class

form3:

Public Class Form3
    Inherits System.Windows.Forms.Form

#Region " Windows 窗体设计器生成的代码 "

    Public Sub New()
        MyBase.New()

        '该调用是 Windows 窗体设计器所必需的。
        InitializeComponent()

        '在 InitializeComponent() 调用之后添加任何初始化

    End Sub

    '窗体重写处置以清理组件列表。
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Windows 窗体设计器所必需的
    Private components As System.ComponentModel.IContainer

    '注意:以下过程是 Windows 窗体设计器所必需的
    '可以使用 Windows 窗体设计器修改此过程。
    '不要使用代码编辑器修改它。
    Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents Button1 As System.Windows.Forms.Button
    Friend WithEvents Label3 As System.Windows.Forms.Label
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.GroupBox1 = New System.Windows.Forms.GroupBox()
        Me.Label1 = New System.Windows.Forms.Label()
        Me.Label2 = New System.Windows.Forms.Label()
        Me.Button1 = New System.Windows.Forms.Button()
        Me.Label3 = New System.Windows.Forms.Label()
        Me.GroupBox1.SuspendLayout()
        Me.SuspendLayout()
        '
        'GroupBox1
        '
        Me.GroupBox1.Controls.AddRange(New System.Windows.Forms.Control() {Me.Label3, Me.Label2, Me.Label1})
        Me.GroupBox1.Location = New System.Drawing.Point(8, 8)
        Me.GroupBox1.Name = "GroupBox1"
        Me.GroupBox1.Size = New System.Drawing.Size(312, 136)
        Me.GroupBox1.TabIndex = 0
        Me.GroupBox1.TabStop = False
        Me.GroupBox1.Text = "关于"
        '
        'Label1
        '
        Me.Label1.Location = New System.Drawing.Point(8, 32)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(296, 32)
        Me.Label1.TabIndex = 0
        Me.Label1.Text = "    本软件由OSTS工作室设计,设计师为 岳洋 ,保留所有权利。"
        '
        'Label2
        '
        Me.Label2.Location = New System.Drawing.Point(8, 104)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(296, 16)
        Me.Label2.TabIndex = 1
        Me.Label2.Text = "    指导老师:unknown,访问被拒绝。"
        '
        'Button1
        '
        Me.Button1.Location = New System.Drawing.Point(8, 152)
        Me.Button1.Name = "Button1"
        Me.Button1.Size = New System.Drawing.Size(312, 32)
        Me.Button1.TabIndex = 1
        Me.Button1.Text = "确定"
        '
        'Label3
        '
        Me.Label3.Location = New System.Drawing.Point(16, 72)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(288, 24)
        Me.Label3.TabIndex = 2
        Me.Label3.Text = "    版本:version 1.0,2005.06.15"
        '
        'Form3
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
        Me.ClientSize = New System.Drawing.Size(328, 190)
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.Button1, Me.GroupBox1})
        Me.MaximizeBox = False
        Me.MinimizeBox = False
        Me.Name = "Form3"
        Me.Text = "关于细菌与抗生素模拟器ver 1.0"
        Me.GroupBox1.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.Dispose()
    End Sub
End Class

others:
Public Class medicine
    Public area As Byte
    Public killrate As Byte
    Sub New()
        area = 15
        killrate = 70
    End Sub
End Class

Public Class bacteria
    Public locate As System.Drawing.Point
    Public antimedicine() As Boolean
    Public alive As Boolean
End Class

博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3