?? form1.vb
字號:
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows 窗體設計器生成的代碼 "
Public Sub New()
MyBase.New()
'該調用是 Windows 窗體設計器所必需的。
InitializeComponent()
'在 InitializeComponent() 調用之后添加任何初始化
End Sub
'窗體重寫 dispose 以清理組件列表。
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 Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents ComboBox1 As System.Windows.Forms.ComboBox
Friend WithEvents ComboBox2 As System.Windows.Forms.ComboBox
Friend WithEvents ComboBox3 As System.Windows.Forms.ComboBox
Friend WithEvents ComboBox4 As System.Windows.Forms.ComboBox
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Button2 As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.Label1 = New System.Windows.Forms.Label
Me.Label2 = New System.Windows.Forms.Label
Me.Label3 = New System.Windows.Forms.Label
Me.Label4 = New System.Windows.Forms.Label
Me.ComboBox1 = New System.Windows.Forms.ComboBox
Me.ComboBox2 = New System.Windows.Forms.ComboBox
Me.ComboBox3 = New System.Windows.Forms.ComboBox
Me.ComboBox4 = New System.Windows.Forms.ComboBox
Me.Button1 = New System.Windows.Forms.Button
Me.Button2 = New System.Windows.Forms.Button
Me.SuspendLayout()
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(16, 16)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(64, 23)
Me.Label1.TabIndex = 0
Me.Label1.Text = "機型"
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(104, 16)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(64, 23)
Me.Label2.TabIndex = 1
Me.Label2.Text = "CPU主頻"
'
'Label3
'
Me.Label3.Location = New System.Drawing.Point(192, 16)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(72, 23)
Me.Label3.TabIndex = 2
Me.Label3.Text = "內存"
'
'Label4
'
Me.Label4.Location = New System.Drawing.Point(288, 16)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(64, 23)
Me.Label4.TabIndex = 3
Me.Label4.Text = "硬盤"
'
'ComboBox1
'
Me.ComboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.Simple
Me.ComboBox1.Location = New System.Drawing.Point(8, 56)
Me.ComboBox1.Name = "ComboBox1"
Me.ComboBox1.Size = New System.Drawing.Size(80, 88)
Me.ComboBox1.TabIndex = 4
Me.ComboBox1.Text = "ComboBox1"
'
'ComboBox2
'
Me.ComboBox2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.ComboBox2.Location = New System.Drawing.Point(96, 56)
Me.ComboBox2.Name = "ComboBox2"
Me.ComboBox2.Size = New System.Drawing.Size(80, 20)
Me.ComboBox2.TabIndex = 5
'
'ComboBox3
'
Me.ComboBox3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.ComboBox3.Location = New System.Drawing.Point(184, 56)
Me.ComboBox3.Name = "ComboBox3"
Me.ComboBox3.Size = New System.Drawing.Size(88, 20)
Me.ComboBox3.TabIndex = 6
'
'ComboBox4
'
Me.ComboBox4.Location = New System.Drawing.Point(280, 56)
Me.ComboBox4.Name = "ComboBox4"
Me.ComboBox4.Size = New System.Drawing.Size(88, 20)
Me.ComboBox4.TabIndex = 7
Me.ComboBox4.Text = "ComboBox4"
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(176, 128)
Me.Button1.Name = "Button1"
Me.Button1.TabIndex = 8
Me.Button1.Text = "確定"
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(280, 128)
Me.Button2.Name = "Button2"
Me.Button2.TabIndex = 9
Me.Button2.Text = "取消"
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(368, 165)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.ComboBox4)
Me.Controls.Add(Me.ComboBox3)
Me.Controls.Add(Me.ComboBox2)
Me.Controls.Add(Me.ComboBox1)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label1)
Me.Name = "Form1"
Me.Text = "微機主要配置"
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ComboBox1.Items.Add("IBM")
ComboBox1.Items.Add("Compaq")
ComboBox1.Items.Add("方正")
ComboBox1.Items.Add("聯想")
ComboBox1.Items.Add("HP")
ComboBox1.Items.Add("Acer")
ComboBox1.Items.Add("DEC")
ComboBox2.Items.Add("奔騰4 1.0G")
ComboBox2.Items.Add("奔騰4 1.2G")
ComboBox2.Items.Add("奔騰4 1.4G")
ComboBox2.Items.Add("奔騰4 1.5G")
ComboBox2.Items.Add("奔騰4 1.7G")
ComboBox2.Items.Add("奔騰4 1.8G")
ComboBox2.Items.Add("奔騰4 2.0G")
ComboBox3.Items.Add("128MB SDRAM")
ComboBox3.Items.Add("256MB DDR")
ComboBox3.Items.Add("256MB DDR 333")
ComboBox3.Items.Add("512MB SDRAM")
ComboBox4.Items.Add("20GB")
ComboBox4.Items.Add("32GB")
ComboBox4.Items.Add("40GB")
ComboBox4.Items.Add("60GB")
ComboBox4.Items.Add("80GB")
End Sub
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim S, c1 As String
c1 = Chr(13) & Chr(10)
S = "所選擇的配置為:″"
S = S & c1 & "機型:″ & ComboBox1.Text"
S = S & c1 & "CPU:" & ComboBox2.Text
S = S & c1 & "內存:" & ComboBox3.Text
S = S & c1 & "硬盤:" & ComboBox4.Text
MsgBox(S, , "微機配置")
End Sub
Private Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
End
End Sub
End Class
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -