Leadtools.WinForms Namespace > RasterImageListItem Class : Invalidate Method |
public void Invalidate()
'Declaration Public Sub Invalidate()
'Usage Dim instance As RasterImageListItem instance.Invalidate()
public void Invalidate()
function Leadtools.WinForms.RasterImageListItem.Invalidate()
public: void Invalidate();
''' Private Sub SelectImageListItem(ByVal imageList As RasterImageList, ByVal itemIndex As Integer) ' Loop through all the items in the list Dim i As Integer = 0 Do While i < imageList.Items.Count Dim item As RasterImageListItem = imageList.Items(i) ' If this is not out item and is selected, de-select it If i <> itemIndex AndAlso item.Selected Then item.Selected = False ' re-paint only this item item.Invalidate() End If ' If this is our item and is not selected already, select it If i = itemIndex AndAlso (Not item.Selected) Then item.Selected = True ' re-paint only this item item.Invalidate() End If i += 1 Loop End Sub
/// private void SelectImageListItem(RasterImageList imageList, int itemIndex) { // Loop through all the items in the list for (int i = 0; i < imageList.Items.Count; i++) { RasterImageListItem item = imageList.Items[i]; // If this is not out item and is selected, de-select it if (i != itemIndex && item.Selected) { item.Selected = false; // re-paint only this item item.Invalidate(); } // If this is our item and is not selected already, select it if (i == itemIndex && !item.Selected) { item.Selected = true; // re-paint only this item item.Invalidate(); } } }
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2