Here's what I have. I don't know what I'm supposed to do to get it working.
Public Class Form1
Inherits System.Windows.Forms.Form
#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 Results As System.Windows.Forms.ListBox
Friend WithEvents txtFirstInteger As System.Windows.Forms.TextBox
Friend WithEvents txtSecondInteger As System.Windows.Forms.TextBox
Friend WithEvents txtThirdInteger As System.Windows.Forms.TextBox
Friend WithEvents btnEnter As System.Windows.Forms.Button
Friend WithEvents lblInstructions As System.Windows.Forms.Label
Friend WithEvents lblFirstInteger As System.Windows.Forms.Label
Friend WithEvents lblSecondInteger As System.Windows.Forms.Label
Friend WithEvents lblThirdInteger As System.Windows.Forms.Label
Private Sub InitializeComponent()
Me.txtFirstInteger = New System.Windows.Forms.TextBox
Me.txtSecondInteger = New System.Windows.Forms.TextBox
Me.txtThirdInteger = New System.Windows.Forms.TextBox
Me.btnEnter = New System.Windows.Forms.Button
Me.Results = New System.Windows.Forms.ListBox
Me.lblInstructions = New System.Windows.Forms.Label
Me.lblFirstInteger = New System.Windows.Forms.Label
Me.lblSecondInteger = New System.Windows.Forms.Label
Me.lblThirdInteger = New System.Windows.Forms.Label
Me.SuspendLayout()
'
'txtFirstInteger
'
Me.txtFirstInteger.Location = New System.Drawing.Point(144, 104)
Me.txtFirstInteger.Name = "txtFirstInteger"
Me.txtFirstInteger.Size = New System.Drawing.Size(136, 20)
Me.txtFirstInteger.TabIndex = 0
Me.txtFirstInteger.Text = "0"
'
'txtSecondInteger
'
Me.txtSecondInteger.Location = New System.Drawing.Point(144, 144)
Me.txtSecondInteger.Name = "txtSecondInteger"
Me.txtSecondInteger.Size = New System.Drawing.Size(136, 20)
Me.txtSecondInteger.TabIndex = 1
Me.txtSecondInteger.Text = "0"
'
'txtThirdInteger
'
Me.txtThirdInteger.Location = New System.Drawing.Point(144, 184)
Me.txtThirdInteger.Name = "txtThirdInteger"
Me.txtThirdInteger.Size = New System.Drawing.Size(136, 20)
Me.txtThirdInteger.TabIndex = 2
Me.txtThirdInteger.Text = "0"
'
'btnEnter
'
Me.btnEnter.Font = New System.Drawing.Font("Microsoft Sans Serif", 15.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnEnter.Location = New System.Drawing.Point(66, 216)
Me.btnEnter.Name = "btnEnter"
Me.btnEnter.Size = New System.Drawing.Size(160, 48)
Me.btnEnter.TabIndex = 3
Me.btnEnter.Text = "Enter"
'
'Results
'
Me.Results.Location = New System.Drawing.Point(24, 272)
Me.Results.Name = "Results"
Me.Results.Size = New System.Drawing.Size(248, 173)
Me.Results.TabIndex = 6
'
'lblInstructions
'
Me.lblInstructions.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblInstructions.Location = New System.Drawing.Point(8, 16)
Me.lblInstructions.Name = "lblInstructions"
Me.lblInstructions.Size = New System.Drawing.Size(272, 72)
Me.lblInstructions.TabIndex = 7
Me.lblInstructions.Text = "Input Three Integers To Find The Sum, Average, Product, Smallest, and Largest"
Me.lblInstructions.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'lblFirstInteger
'
Me.lblFirstInteger.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblFirstInteger.Location = New System.Drawing.Point(8, 104)
Me.lblFirstInteger.Name = "lblFirstInteger"
Me.lblFirstInteger.Size = New System.Drawing.Size(104, 24)
Me.lblFirstInteger.TabIndex = 8
Me.lblFirstInteger.Text = "First Integer"
Me.lblFirstInteger.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'
'lblSecondInteger
'
Me.lblSecondInteger.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblSecondInteger.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.lblSecondInteger.Location = New System.Drawing.Point(8, 144)
Me.lblSecondInteger.Name = "lblSecondInteger"
Me.lblSecondInteger.Size = New System.Drawing.Size(120, 24)
Me.lblSecondInteger.TabIndex = 9
Me.lblSecondInteger.Text = "Second Integer"
'
'lblThirdInteger
'
Me.lblThirdInteger.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblThirdInteger.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.lblThirdInteger.Location = New System.Drawing.Point(8, 184)
Me.lblThirdInteger.Name = "lblThirdInteger"
Me.lblThirdInteger.Size = New System.Drawing.Size(104, 24)
Me.lblThirdInteger.TabIndex = 10
Me.lblThirdInteger.Text = "Third Integer"
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(292, 470)
Me.Controls.Add(Me.lblThirdInteger)
Me.Controls.Add(Me.lblSecondInteger)
Me.Controls.Add(Me.lblFirstInteger)
Me.Controls.Add(Me.lblInstructions)
Me.Controls.Add(Me.Results)
Me.Controls.Add(Me.btnEnter)
Me.Controls.Add(Me.txtThirdInteger)
Me.Controls.Add(Me.txtSecondInteger)
Me.Controls.Add(Me.txtFirstInteger)
Me.Name = "Form1"
Me.Text = "Input Three Integers"
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim number1, number2, number3 As Integer ' Declares number1, number2, number3
Dim sum, average, product As Integer ' Declares sum, average, product
Dim smallest, largest As Integer ' Declares largest, smallest
number1 = Me.txtFirstInteger.Text
number2 = Me.txtSecondInteger.Text
number3 = Me.txtThirdInteger.Text
sum = number1 + number2 + number3
average = sum / 3
product = number1 * number2 * number3
If number1 < number2 & number1 < number3 Then
smallest = number1
End If
If number2 < number1 & number2 < number3 Then
smallest = number2
End If
If number3 < number1 & number3 < number2 Then
smallest = number3
End If
If number1 > number2 & number1 > number3 Then
largest = number1
End If
If number2 > number1 & number2 > number3 Then
largest = number2
End If
If number3 > number1 & number3 > number2 Then
largest = number3
End If
Me.Results.Text = "number1"
Me.Results.Text = "number2"
Me.Results.Text = "number3"
Me.Results.Text = "sum"
Me.Results.Text = "average"
Me.Results.Text = "product"
Me.Results.Text = "smallest"
Me.Results.Text = "largest"
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEnter.Click
End Sub
End Class
2007-03-21
17:33:47
·
2 answers
·
asked by
bloodyhell1981
1