ModuleListPage.LargeImageList Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the list of large images.
protected:
property System::Windows::Forms::ImageList ^ LargeImageList { System::Windows::Forms::ImageList ^ get(); };
protected System.Windows.Forms.ImageList LargeImageList { get; }
member this.LargeImageList : System.Windows.Forms.ImageList
Protected ReadOnly Property LargeImageList As ImageList
Property Value
The ImageList object.
Examples
The following example clears the large-image and small-image list collections and adds new images.
private void LoadPages() {
ListView.BeginUpdate();
try {
ImageList.ImageCollection largeImages
= LargeImageList.Images;
ImageList.ImageCollection smallImages
= SmallImageList.Images;
smallImages.Clear();
largeImages.Clear();
smallImages.Add("mySmallImg",
myGetImage(16));
largeImages.Add("myLargeImg",
myGetImage(32));
// Populate the list of features
IControlPanel controlPanel =
(IControlPanel)GetService(typeof(IControlPanel));
Debug.Assert(controlPanel != null,
"Couldn't get IControlPanel!");
Type moduleChildPageType =
typeof(IModuleChildPage);
ModulePageInfo controlPanelPage =
controlPanel.ControlPanelPage;
View view = ListView.View;
List<ListViewItem> itemsList =
new List<ListViewItem>();
foreach (ModulePageInfo pageInfo
in controlPanel.Pages) {
Type pageType = pageInfo.PageType;
// Don't add child, home
// or disabled pages
if (!moduleChildPageType.IsAssignableFrom(pageType) &&
(pageInfo != controlPanelPage) &&
pageInfo.IsEnabled) {
PageListViewItem newItem =
new PageListViewItem(pageInfo);
// Filter out pages that don't match
// current filter
if (!String.IsNullOrEmpty(
_filter.FilterStr) &&
newItem.Text.ToUpper().Contains(
_filter.FilterStr.ToUpper())
)
continue;
Image smallImage = (Image)pageInfo.SmallImage;
Image largeImage = (Image)pageInfo.LargeImage;
if (smallImage == null)
smallImage = myGetImage(16);
if (largeImage == null)
largeImage = myGetImage(32);
newItem.ImageKey = newItem.Text;
newItem.UpdateDescription(view);
itemsList.Add(newItem);
}
}
ListView.ListViewItemCollection items =
ListView.Items;
items.Clear();
items.AddRange(itemsList.ToArray());
if (SelectedGrouping != null)
OnGroup(SelectedGrouping);
if (view == View.SmallIcon)
((ListPageListView)ListView).View = view;
} finally {
ListView.EndUpdate();
Update();
}
}
Remarks
If the LargeImageList property has not been set, the get
accessor returns an empty System.Windows.Forms.ImageList object that has a size of 32 by 32 pixels and a color depth of 32 bits.