Public Class Form1
    Dim temp As Integer = 1
    Dim nume As String

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Label1.Text = ComboBox1.Items.Count
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If ComboBox1.Text <> "" Then
            If ComboBox1.Items.Contains(ComboBox1.Text) = False Then
                ComboBox1.Items.Add(ComboBox1.Text)
                Label1.Text = Str(Val(Label1.Text) + 1)
            Else
                MsgBox("Clientul exista deja in lista!", 32)
            End If
        End If
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        If ComboBox1.Text <> "" Then
            If ComboBox1.Items.Contains(ComboBox1.Text) = True Then
                ComboBox1.Items.Remove(ComboBox1.Text)
                Label1.Text = Str(Val(Label1.Text) - 1)
                ComboBox1.Text = ""
            Else
                MsgBox("Clientul nu exista in lista!", 32)
            End If
        End If
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        If ComboBox1.Text <> "" Then
            nume = InputBox("Scrieti noua denumire pentru clientul: " & ComboBox1.Text)
            ComboBox1.Items.Remove(ComboBox1.Text)
            ComboBox1.Text = nume
        End If
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        ComboBox1.Items.Clear()
        Label1.Text = Str(0)
        ComboBox1.Text = ""
    End Sub
End Class
