?? form1.vb
字號:
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows 窗體設計器生成的代碼 "
Public Sub New()
MyBase.New()
'該調(diào)用是 Windows 窗體設計器所必需的。
InitializeComponent()
'在 InitializeComponent() 調(diào)用之后添加任何初始化
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 lb1 As System.Windows.Forms.Label
Friend WithEvents lb2 As System.Windows.Forms.Label
Friend WithEvents bt1 As System.Windows.Forms.Button
Friend WithEvents TB1 As System.Windows.Forms.TextBox
Friend WithEvents TB2 As System.Windows.Forms.TextBox
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.lb1 = New System.Windows.Forms.Label
Me.lb2 = New System.Windows.Forms.Label
Me.bt1 = New System.Windows.Forms.Button
Me.TB1 = New System.Windows.Forms.TextBox
Me.TB2 = New System.Windows.Forms.TextBox
Me.SuspendLayout()
'
'lb1
'
Me.lb1.Location = New System.Drawing.Point(8, 24)
Me.lb1.Name = "lb1"
Me.lb1.Size = New System.Drawing.Size(136, 32)
Me.lb1.TabIndex = 0
Me.lb1.Text = "球半徑"
'
'lb2
'
Me.lb2.Location = New System.Drawing.Point(8, 80)
Me.lb2.Name = "lb2"
Me.lb2.Size = New System.Drawing.Size(136, 32)
Me.lb2.TabIndex = 1
Me.lb2.Text = "球體積"
'
'bt1
'
Me.bt1.Location = New System.Drawing.Point(80, 176)
Me.bt1.Name = "bt1"
Me.bt1.Size = New System.Drawing.Size(112, 32)
Me.bt1.TabIndex = 2
Me.bt1.Text = "計算"
'
'TB1
'
Me.TB1.Location = New System.Drawing.Point(160, 24)
Me.TB1.Name = "TB1"
Me.TB1.Size = New System.Drawing.Size(112, 21)
Me.TB1.TabIndex = 3
Me.TB1.Text = ""
'
'TB2
'
Me.TB2.Location = New System.Drawing.Point(160, 80)
Me.TB2.Name = "TB2"
Me.TB2.Size = New System.Drawing.Size(112, 21)
Me.TB2.TabIndex = 4
Me.TB2.Text = ""
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(292, 266)
Me.Controls.Add(Me.TB2)
Me.Controls.Add(Me.TB1)
Me.Controls.Add(Me.bt1)
Me.Controls.Add(Me.lb2)
Me.Controls.Add(Me.lb1)
Me.Name = "Form1"
Me.Text = "Form1"
Me.ResumeLayout(False)
End Sub
#End Region
Public Function spereVolum(ByVal r As Double) As Double
Dim volum As Double
volum = (4.0 / 3.0) * Math.PI * Math.Pow(r, 3)
Return volum
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt1.Click
Dim r, v As Double
r = Double.Parse(TB1.Text)
v = spereVolum(r)
TB1.Text = r
TB2.Text = v
End Sub
End Class
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -