3 replies
by whitney_willis4 Accepted solution
by jiminpa Accepted solution
by whitney_willis4 Accepted solution
Private Sub multiplyButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles multiplyButton.Click
' initialization phase
Dim result As Integer = 0
Dim operandCounter As Integer = 0
Dim operand1 As Integer = 0
Dim operand2 As Integer = 0
' multiply operands from ListBox
Do
' read operands from ListBox
operand1 = OperandsListBox.Items.Item(operandCounter)
operand2 = OperandsListBox.Items.Item(operandCounter)
result = (operand1 * operand2) ' multiply operands by eachother
operandCounter *= 2 ' increment counter
Loop While operandCounter >= 2
resultLabel.Text = String.Format("{0:G}", result)
multiplyButton.Enabled = True ' Enable Multiply Button
inputTextBox.Focus() 'reset focus to Enter operand: Textbox
End Sub ' multiplyButton_Click
This discussion is closed to new replies.
Trending Software posts
Sort by Trending