Visual Basic (Usage) | Copy Code |
---|---|
|
Parameters
- index
- The zero-based index of the item to scroll into view.
This example will add a new item to the end of a ImageList control and make sure the item is visible to the user.
Visual Basic | Copy Code |
---|---|
Public Sub ImageList_EnsureVisible(ByVal imageList As ImageList) |
C# | Copy Code |
---|---|
public void ImageList_EnsureVisible(ImageList imageList) |
You can use this method to ensure that a specific item is visible within the ImageList control. When performing validation on the items in an ImageList, you can call the EnsureVisible method to ensure that an item that failed validation is displayed in the ImageList control to allow the user to perform changes on the item. If the item that you want to ensure is visible is located above the viewable region of the ImageList control, calling the EnsureVisible method will scroll the contents of the control until it is the first item in the viewable area of the control. If the item is below the viewable region of the ImageList control, calling the EnsureVisible method will scroll the contents of the ImageList control until the item is the last item in the viewable area of the control.
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Vista, and Windows Server 2003 family