Coding for Temp Conversion (Visual Studio .NET
... Me.Button2.Font = New System.Drawing.Font("NSimSun", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Button2.Location = New System.Drawing.Point(256, 280)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(56, 24)
Me.Button2.TabIndex = 5
Me.Button2.Text = "EXIT"
'
'tempResult
'
Me.tempResult.Location = New System.Drawing.Point(248, 232)
Me.tempResult.Name = "tempResult"
Me.tempResult.Size = New System.Drawing.Size(64, 24)
Me.tempResult.TabIndex = 6
'
'TempConversion
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(552, 406)
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.tempResult, Me.Button2, Me.convertTemp, Me.Label2, Me.lblTempInput, Me.Label1})
Me.Name = "TempConversion"
Me.Text = "Form1"
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub convertTemp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles convertTemp.Click
tempResult.Text = " "
Dim tempInput As Integer = lblTempInput.Text
Dim finalTemp As Integer = fiveNine * (tempInput - 32)
tempResult.Text = finalTemp.ToString()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Application.Exit()
End Sub
End Class
------------------------------------------------------------------------------------------------
Public Class Form1
Inherits System.Windows.Forms.Form
Dim totalPrice As Integer = 0
Dim tenPercent As Integer = 0.1
Dim twentyPercent As Integer = 0.2
Dim thirtyPercent As Integer = 0.3
Dim fourtyPercent As Integer = 0.4
Dim fiftyPercent As Integer = 0.5
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
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
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents lblPrice As System.Windows.Forms.Label
Friend WithEvents cboSelect As System.Windows.Forms.ComboBox
Friend WithEvents chkChair As System.Windows.Forms.CheckBox
Friend WithEvents chkBed As System.Windows.Forms.CheckBox
Friend WithEvents chkTable As System.Windows.Forms.CheckBox