vb.net - "Object reference not set to an instance of an object" error when using radio buttons to fill in a listbox -
i wanted ask if knew why might getting error object reference not set instance of object
when try fill in listbox playlist function on media player trying make.
public class playlistsform private sub radiobutton1_checkedchanged(byval sender system.object, byval e system.eventargs) handles radiobutton1.checkedchanged listbox1.items.clear() each item string in my.settings.playlist1 listbox1.items.add(item) next end sub private sub radiobutton2_checkedchanged(byval sender system.object, byval e system.eventargs) handles radiobutton2.checkedchanged dim pl2 new setting(my.settings.playlist2) listbox1.items.clear() each item string in my.settings.playlist2 listbox1.items.clear() listbox1.items.add(item) next end sub private sub radiobutton3_checkedchanged(byval sender system.object, byval e system.eventargs) handles radiobutton3.checkedchanged listbox1.items.clear() each item string in my.settings.playlist3 listbox1.items.clear() listbox1.items.add(item) next end sub private sub radiobutton4_checkedchanged(byval sender system.object, byval e system.eventargs) handles radiobutton4.checkedchanged listbox1.items.clear() each item string in my.settings.playlist4 listbox1.items.clear() listbox1.items.add(item) next end sub private sub radiobutton5_checkedchanged(byval sender system.object, byval e system.eventargs) handles radiobutton5.checkedchanged listbox1.items.clear() each item string in my.settings.playlist5 listbox1.items.clear() listbox1.items.add(item) next end sub private sub label1_click(byval sender system.object, byval e system.eventargs) handles label1.click listbox1.selecteditems.clear() end sub end class
sorry - error happening here: (error 'object reference not set instance of object')
private sub radiobutton1_checkedchanged(byval sender system.object, byval e system.eventargs) handles radiobutton1.checkedchanged listbox1.items.clear() each item string in my.settings.playlist1 listbox1.items.add(item) next end sub private sub radiobutton2_checkedchanged(byval sender system.object, byval e system.eventargs) handles radiobutton2.checkedchanged dim pl2 new setting(my.settings.playlist2) listbox1.items.clear() each item string in my.settings.playlist2 listbox1.items.clear() listbox1.items.add(item) next end sub private sub radiobutton3_checkedchanged(byval sender system.object, byval e system.eventargs) handles radiobutton3.checkedchanged listbox1.items.clear() each item string in my.settings.playlist3 listbox1.items.clear() listbox1.items.add(item) next end sub private sub radiobutton4_checkedchanged(byval sender system.object, byval e system.eventargs) handles radiobutton4.checkedchanged listbox1.items.clear() each item string in my.settings.playlist4 listbox1.items.clear() listbox1.items.add(item) next end sub private sub radiobutton5_checkedchanged(byval sender system.object, byval e system.eventargs) handles radiobutton5.checkedchanged listbox1.items.clear() each item string in my.settings.playlist5 listbox1.items.clear() listbox1.items.add(item) next end sub
Comments
Post a Comment