all good now, makes alot of sence.
i want to stop a name being being doubled in a listbox. so when i click the add button, it will check if the name from the text box is already in the listbox. if so it will pop up a message 'enter another name'
i am not sure what listbox function to use.
vb Code:
Dim studentname As String
studentname = studenttextbox.Text
If studentname = "" Then
MessageBox.Show("You Need to enter a Name")
ElseIf studentname Is studentnameslistbox.Text Then
'how do i make it so the studentname cant already be in the listbox to prevent double up of names.
MessageBox.Show("Name already in use")
Else
studentnameslistbox.Items.Add(studenttextbox.Text)
End If
studenttextbox.Clear()
i have got the message to appear if the textbox is blank so just need help with the next bit
cheers