Sign in to follow this  
c0uchm0nster

Windows forms noob

Recommended Posts

c0uchm0nster    182
Hey, I'm writing a map editor and I've realized that I know even less about windows forms than I thought I did. MSDN is an alright source, but there are some times when I just don't know what to look up or which option is best. Specifically right now I'm trying to populate a listview (or treeview or some other view) that will list images/objects from a flatfile of some kind (either xml or xls). I've seen how to add an individual item to a listview, but I'm not sure how to do much else (i.e. load in an entire file of data, pass that data to something when it's double-clicked in the view, load the corresponding images in the view). If anyone knows of a good source of info or can just tell me how to do that all I'd be very grateful. Thanks

Share this post


Link to post
Share on other sites
jpetrie    13099
Quote:

I've seen how to add an individual item to a listview

Break your problem down and start from things you know. If you can add one item to a listview, you can add N (use a loop). Obviously having the items you want to add in an array of some sort would be useful. You can acquire an array by reading each element from your file and adding it to an array or List<T> (or if the items are strings, you can use the File.ReadAllLines() function which returns a string[]).

Unfortunately I don't have any other resources to offer you; I've been able to find everything I've needed on MSDN.

Share this post


Link to post
Share on other sites
c0uchm0nster    182
So then a listview is my best bet? And there's no better way than a flatfile read in with a loop & using custom fields in the listview? and then how do i sync that data with images to display in the listview?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this