Wednesday, 15 February 2012

c# - Add ListView objects to an array -



c# - Add ListView objects to an array -

is there way add together listview objects array can address them loop?

public static listview taglistview; public static listview commonlistview; public static listview recentlistview; public static listview[] listviews = { taglistview, commonlistview, recentlistview };

this code results in listviews array items beingness null. have tried few variations of same results. possible do? seems need create array of pointers these 3 objects.

i trying because listviews part different , having names makes much more readable having 3 items in array every 1 time in while need same thing three.

you got it. need instantiate listviews.

public static listview taglistview = new listview(); public static listview commonlistview = new listview(); public static listview recentlistview = new listview(); public static listview[] listviews = { taglistview, commonlistview, recentlistview };

c# arrays object

No comments:

Post a Comment