Retrieves the bounding rectangle for a specific item within the
RasterImageList control.
Syntax
Example
This example will highlight the position of all visible items a RasterImageList control.
Visual Basic | Copy Code |
---|
Public Sub RasterImageList_GetItemRectangle(ByVal imageList As RasterImageList)
For Each item As RasterImageListItem In imageList.Items
Dim rc As Rectangle = imageList.GetItemRectangle(item)
If imageList.ClientRectangle.IntersectsWith(rc) Then
rc = imageList.RectangleToScreen(rc)
ControlPaint.DrawReversibleFrame(rc, Color.Transparent, FrameStyle.Thick)
End If
Next item
End Sub |
C# | Copy Code |
---|
public void RasterImageList_GetItemRectangle(RasterImageList imageList) { // Loop through all items foreach(RasterImageListItem item in imageList.Items) { // Get the item bounding rectangle Rectangle rc = imageList.GetItemRectangle(item); // If this rectangle is visible, highlight it if(imageList.ClientRectangle.IntersectsWith(rc)) { // Convert the rectangle to screen coordinates rc = imageList.RectangleToScreen(rc); ControlPaint.DrawReversibleFrame(rc, Color.Transparent, FrameStyle.Thick); } } } |
Remarks
Requirements
Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
See Also