Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I just wanted to take a listbox value to existing labels on different forms. an error on this code :

VB
keyword.Content = w_list.ListBox1.SelectedItem.ToString


can anybody help me?
Posted
Comments
Kornfeld Eliyahu Peter 17-Feb-15 3:07am    
One of the elements in w_list.ListBox1.SelectedItem is nothing...Use debugger to see which one...
Raditya ZXY 18-Feb-15 0:11am    
I put the item listbox on the form w_list, I load the listbox item from notepad.
the problem is an error in the form p_list, where the label that I used to read the value of the items in the form w_list an error:

Object reference not set to an instance of an object

line error : line label.Content = w_list.ListBox1.SelectedItem.ToString

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900