0

Hi,

I'm totally new in using VB and I want your help.
I need a sample code that has a (combobox) and an (add) button that makes the user clicks on the (add) button to add text to the (combobox).

Thank you.

Edited by Alex_2011: n/a

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by Reverend Jim
0
Public Class Form1

    Private Sub btnAdd_Click(sender As System.Object, e As System.EventArgs) Handles btnAdd.Click

        ComboBox1.Items.Add(Now)

    End Sub

End Class

Each time you click "Add", the current date/time will be added to the combobox. Just replace the argument with the text you want to add.

Edited by Reverend Jim: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.