vb.net - Writing a specific listview tag property to a text file -
the code below removed user listview based on name. want add ability first write listview's tag property text file first i'm confused how should specify listview item want tag before removing it. can advise me? thanks.
public sub removeuser(byval name object) if _mainview.lvwchannelusers.invokerequired _mainview.lvwchannelusers.invoke(new parameterizedthreadstart(addressof removeuser), name) else dim lvi listviewitem = getlistviewitemsindex(directcast(name, string)) dim file_name string = application.startuppath & "\accounts\" & directcast(name, string) dim objwriter new system.io.streamwriter(file_name) objwriter.write("this need call tag write.") objwriter.close() _mainview.lvwchannelusers.items.remove(lvi) end if end sub
here have corrected version of sub
performing actions want:
public sub removeuser(byval name object) if _mainview.lvwchannelusers.invokerequired _mainview.lvwchannelusers.invoke(new parameterizedthreadstart(addressof removeuser), name) else dim lvi listviewitem = _mainview.lvwchannelusers.finditemwithtext(directcast(name, string)) dim file_name string = application.startuppath & "\accounts\" & directcast(name, string) dim objwriter new system.io.streamwriter(file_name) objwriter.write(lvi.tag) objwriter.close() _mainview.lvwchannelusers.items.remove(lvi) end if end sub
Comments
Post a Comment