'用VB.net制作一个小程序(3)

' 用 VB.net 制作一个小程序( 3 )

---- 制作“ Input Controls ”程序 (3)

接上

'PictureBox2

'

Me .PictureBox2.Location = New System.Drawing.Point(480, 136)

Me .PictureBox2.Name = "PictureBox2"

Me .PictureBox2.Size = New System.Drawing.Size(80, 56)

Me .PictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage

Me .PictureBox2.TabIndex = 10

Me .PictureBox2.TabStop = False

'

'PictureBox3

'

Me .PictureBox3.Location = New System.Drawing.Point(376, 224)

Me .PictureBox3.Name = "PictureBox3"

Me .PictureBox3.Size = New System.Drawing.Size(80, 72)

Me .PictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage

Me .PictureBox3.TabIndex = 11

Me .PictureBox3.TabStop = False

'

'PictureBox4

'

Me .PictureBox4.Location = New System.Drawing.Point(480, 224)

Me .PictureBox4.Name = "PictureBox4"

Me .PictureBox4.Size = New System.Drawing.Size(80, 64)

Me .PictureBox4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage

Me .PictureBox4.TabIndex = 12

Me .PictureBox4.TabStop = False

'

'PictureBox5

'

Me .PictureBox5.Location = New System.Drawing.Point(368, 312)

Me .PictureBox5.Name = "PictureBox5"

Me .PictureBox5.Size = New System.Drawing.Size(88, 56)

Me .PictureBox5.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage

Me .PictureBox5.TabIndex = 13

Me .PictureBox5.TabStop = False

'

'Form1

'

Me .AutoScaleBaseSize = New System.Drawing.Size(6, 14)

Me .ClientSize = New System.Drawing.Size(592, 374)

Me .Controls.AddRange( New System.Windows.Forms.Control() { Me .PictureBox5, Me .PictureBox4, Me .PictureBox3, Me .PictureBox2, Me .PictureBox1, Me .Label4, Me .ComboBox1, Me .Button1, Me .Label3, Me .Label2, Me .ListBox1, Me .Label1, Me .GroupBox2, Me .GroupBox1})

Me .Name = "Form1"

Me .Text = "Form1"

Me .GroupBox1.ResumeLayout( False )

Me .GroupBox2.ResumeLayout( False )

Me .ResumeLayout( False )

End Sub

End Region

Private Sub Label4_Click( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label4.Click

End Sub

Private Sub Label3_Click( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label3.Click

End Sub

Private Sub CheckBox1_CheckedChanged( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged

If CheckBox1.CheckState = 1 Then

PictureBox2.Image = System.Drawing.Image.FromFile _

("C:\Documents and Settings\gaoshan\My Documents\VB\Input Controls\Input Controls\0565.jpg")

PictureBox2.Visible = True

Else

PictureBox2.Visible = False

End If

End Sub

Private Sub ListBox1_SelectedIndexChanged( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged

Select Case ListBox1.SelectedIndex

Case 0

PictureBox3.Image = System.Drawing.Image.FromFile _

("C:\Documents and Settings\gaoshan\My Documents\VB\Input Controls\Input Controls\0004.jpg")

Case 1

PictureBox3.Image = System.Drawing.Image.FromFile _

("C:\Documents and Settings\gaoshan\My Documents\VB\Input Controls\Input Controls\0005.jpg")

Case 2

PictureBox3.Image = System.Drawing.Image.FromFile _

("C:\Documents and Settings\gaoshan\My Documents\VB\Input Controls\Input Controls\0010.jpg")

End Select

End Sub

Private Sub Form1_Load( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase .Load

PictureBox1.Image = System.Drawing.Image.FromFile _

("C:\Documents and Settings\gaoshan\My Documents\VB\Input Controls\Input Controls\0513.jpg")

ListBox1.Items.Add("Extra a had disk")

ListBox1.Items.Add("Printer")

ListBox1.Items.Add("Statellite dish")

ComboBox1.Items.Add("U.S.Dollars")

ComboBox1.Items.Add("Check")

ComboBox1.Items.Add("English Pounds")

End Sub

Private Sub CheckBox2_CheckedChanged( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox2.CheckedChanged

If CheckBox2.CheckState = 1 Then

PictureBox4.Image = System.Drawing.Image.FromFile _

("C:\Documents and Settings\gaoshan\My Documents\VB\Input Controls\Input Controls\0387.jpg")

PictureBox4.Visible = True

Else

PictureBox4.Visible = False

End If

End Sub

Private Sub CheckBox3_CheckedChanged( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox3.CheckedChanged

If CheckBox3.CheckState = 1 Then

PictureBox5.Image = System.Drawing.Image.FromFile _

("C:\Documents and Settings\gaoshan\My Documents\VB\Input Controls\Input Controls\0043.jpg")

PictureBox5.Visible = True

Else

PictureBox5.Visible = False

End If

End Sub

End Class

全文完

Published At
Categories with Web编程
Tagged with
comments powered by Disqus