Ok, I have a listbox that has a double click event on it. If you strike the items in the list the program works perfectly without a problem, but if you hit white space, the program blows up.
The frmOpen has a rich text box that uses the data from transfername on it to call forth a name from another system.
The question I have, Is there a way to show the system that there is nothing being clicked? I have tried the selecteditem = 0 and -1 and the selectedindex = 0 and -1 nothing happened. I'm kind of lost on this one. Trying to make this work for my new job.
VB.net 2010 Professional Edition.Code:Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.MouseDoubleClick Dim transfername As String = ListBox1.SelectedItem.ToString() frmOpen.Show() frmOpen.filename = transfername End Sub




Reply With Quote
