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 Private Sub InitializeComponent() Me.Label1 = New System.Windows.Forms.Label() Me.cboSelect = New System.Windows.Forms.ComboBox() Me.Label2 = New System.Windows.Forms.Label() Me.chkChair = New System.Windows.Forms.CheckBox() Me.chkBed = New System.Windows.Forms.CheckBox() Me.chkTable = New System.Windows.Forms.CheckBox() Me.lblPrice = New System.Windows.Forms.Label() Me.Label4 = New System.Windows.Forms.Label() Me.SuspendLayout() ' 'Label1 ' Me.Label1.Font = New System.Drawing.Font("MS PGothic", 26.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label1.ForeColor = System.Drawing.Color.Red Me.Label1.Location = New System.Drawing.Point(48, 16) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(448, 40) Me.Label1.TabIndex = 0 Me.Label1.Text = "Joes Furniture Store" Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'cboSelect ' Me.cboSelect.Items.AddRange(New Object() {"10 ", "20 ", "30 ", "40 ", "50 "}) Me.cboSelect.Location = New System.Drawing.Point(48, 112) Me.cboSelect.Name = "cboSelect" Me.cboSelect.Size = New System.Drawing.Size(128, 21) Me.cboSelect.TabIndex = 1 ' 'Label2 ' Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label2.Location = New System.Drawing.Point(40, 96) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(152, 16) Me.Label2.TabIndex = 2 Me.Label2.Text = "Discount Rate: (%)" ' 'chkChair ' Me.chkChair.Location = New System.Drawing.Point(320, 112) Me.chkChair.Name = "chkChair" Me.chkChair.Size = New System.Drawing.Size(120, 24) Me.chkChair.TabIndex = 3 Me.chkChair.Text = "Chair" ' 'chkBed ' Me.chkBed.Location = New System.Drawing.Point(320, 136) Me.chkBed.Name = "chkBed" Me.chkBed.Size = New System.Drawing.Size(120, 24) Me.chkBed.TabIndex = 4 Me.chkBed.Text = "Bed" ' 'chkTable ' Me.chkTable.Location = New System.Drawing.Point(320, 160) Me.chkTable.Name = "chkTable" Me.chkTable.Size = New System.Drawing.Size(120, 24) Me.chkTable.TabIndex = 5 Me.chkTable.Text = "Table" ' 'lblPrice ' Me.lblPrice.Location = New System.Drawing.Point(224, 272) Me.lblPrice.Name = "lblPrice" Me.lblPrice.Size = New System.Drawing.Size(120, 24) Me.lblPrice.TabIndex = 6 ' 'Label4 ' Me.Label4.BackColor = System.Drawing.Color.White Me.Label4.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label4.Location = New System.Drawing.Point(144, 272) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(56, 16) Me.Label4.TabIndex = 7 Me.Label4.Text = "Total:" Me.Label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'Form1 ' Me.AllowDrop = True Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(560, 358) Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.Label4, Me.lblPrice, Me.chkTable, Me.chkBed, Me.chkChair, Me.Label2, Me.cboSelect, Me.Label1}) Me.Name = "Form1" Me.Text = "Form1" Me.ResumeLayout(False) End Sub #End Region Private Sub chkChair_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkChair.CheckedChanged lblPrice.Text = " " Dim chair As Integer = 100 totalPrice = totalPrice + chair lblPrice.Text = totalPrice.ToString() End Sub Private Sub chkBed_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventAr...

Essay Information


Words: 1640
Pages: 6.6
Rating: None

All Papers Are For Research And Reference Purposes Only. You must cite our web site as your source.