24 Program to Sum of items in Combo Box in VB.NET.

Code:

Public Class Form1

    Public Class Add
        Public i, sum As Integer

        Sub display()
            sum = 0
            For i = 0 To 3
                sum = sum + Form1.ComboBox1.Items(i)
            Next
            MsgBox("Addition=" & sum)
        End Sub
    End Class

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim add As Add
        add = New Add
        add.display()
    End Sub
End Class




Output:  



Previous
Next Post »