click
event handler.
Now, create a string variable to store the data that you have input and set the value on it.
Dim inputdata As String = Nothing
Const msg As String = "Input data"
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click 'CLEARING THE DATA IN THE LISTBOX ListBox1.Items.Clear() End Sub
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 'SET A STRING VARIABLE FOR THE DATA 'TO BE INPUT AND FOR THE MESSAGE OF THE INPUTBOX Dim inputdata As String = Nothing Const msg As String = "Input data" 'ADDING THE DATA IN THE LISTBOX THROUGH INPUTBOX End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click 'CLEARING THE DATA IN THE LISTBOX ListBox1.Items.Clear() End Sub End Class