LEADTOOLS Windows Forms (Leadtools.WinForms assembly)
LEAD Technologies, Inc

ScrollStyle Property (RasterImageList)

Example 





Specifies the direction the RasterImageList Control scrolls the displayed items.
Syntax
[CategoryAttribute("Behavior")]
[DescriptionAttribute("Specifies the direction the control scrolls the displayed items.")]
public RasterImageListScrollStyle ScrollStyle {get; set;}
'Declaration
 
<CategoryAttribute("Behavior")>
<DescriptionAttribute("Specifies the direction the control scrolls the displayed items.")>
Public Property ScrollStyle As RasterImageListScrollStyle
'Usage
 
Dim instance As RasterImageList
Dim value As RasterImageListScrollStyle
 
instance.ScrollStyle = value
 
value = instance.ScrollStyle
[CategoryAttribute("Behavior")]
[DescriptionAttribute("Specifies the direction the control scrolls the displayed items.")]
public RasterImageListScrollStyle ScrollStyle {get; set;}
CategoryAttribute("Behavior")
DescriptionAttribute("Specifies the direction the control scrolls the displayed items.")
 get_ScrollStyle();
set_ScrollStyle(value);
[CategoryAttribute("Behavior")]
[DescriptionAttribute("Specifies the direction the control scrolls the displayed items.")]
public:
property RasterImageListScrollStyle ScrollStyle {
   RasterImageListScrollStyle get();
   void set (    RasterImageListScrollStyle value);
}

Property Value

A RasterImageListScrollStyle enumeration that specifies the direction the RasterImageList Control scrolls the displayed items. Default value is RasterImageListScrollStyle.Vertical.
Example
 
Public Sub RasterImageList_ScrollStyle(ByVal imageList As RasterImageList)
   ' Clear out any items in the image list
   imageList.Items.Clear()
   ' Create 20 items
   For i As Integer = 0 To 19
      ' Load the image
      Dim index As Integer = i + 1
      Dim item As RasterImageListItem = New RasterImageListItem(Nothing, 1, "Item" & index.ToString())

      ' Select every otehr item
      If (i Mod 2) = 0 Then
         item.Selected = True
      End If

      ' Add the item to the image list
      imageList.Items.Add(item)
   Next i

   ' Set vertical scrolling style
   imageList.ScrollStyle = RasterImageListScrollStyle.Vertical

   ' Scroll a couple of lines down
   imageList.ScrollItems(2)

   ' Show the scroll parameters of the control
   ShowScrollParameters(imageList)

   ' Switch to horizontal scrolling style
   imageList.ScrollStyle = RasterImageListScrollStyle.Horizontal

   ' Show the scroll parameters of the control
   ShowScrollParameters(imageList)
End Sub


Private Sub ShowScrollParameters(ByVal imageList As RasterImageList)
   Dim sb As StringBuilder = New StringBuilder()
   sb.AppendFormat("Full Visible Rows: {0}{1}", imageList.FullVisibleRows, Environment.NewLine)
   sb.AppendFormat("Visible Rows: {0}{1}", imageList.VisibleRows, Environment.NewLine)
   sb.AppendFormat("Full Visible Columns: {0}{1}", imageList.FullVisibleColumns, Environment.NewLine)
   sb.AppendFormat("Visible Columns:{0}{1}", imageList.VisibleColumns, Environment.NewLine)
   sb.AppendFormat("TotalRows: {0}{1}", imageList.TotalRows, Environment.NewLine)
   sb.AppendFormat("TotalColumns: {0}{1}", imageList.TotalColumns, Environment.NewLine)
   sb.AppendFormat("TopIndex: {0}{1}", imageList.TopIndex, Environment.NewLine)
   MessageBox.Show(sb.ToString())
End Sub
public void RasterImageList_ScrollStyle(RasterImageList imageList)
{
   // Clear out any items in the image list
   imageList.Items.Clear();
   // Create 20 items
   for(int i = 0; i < 20; i++)
   {
      // Load the image
      int index = i + 1;
      RasterImageListItem item = new RasterImageListItem(null, 1, "Item" + index.ToString());

      // Select every otehr item
      if((i % 2) == 0)
         item.Selected = true;

      // Add the item to the image list
      imageList.Items.Add(item);
   }

   // Set vertical scrolling style
   imageList.ScrollStyle = RasterImageListScrollStyle.Vertical;

   // Scroll a couple of lines down
   imageList.ScrollItems(2);

   // Show the scroll parameters of the control
   ShowScrollParameters(imageList);

   // Switch to horizontal scrolling style
   imageList.ScrollStyle = RasterImageListScrollStyle.Horizontal;

   // Show the scroll parameters of the control
   ShowScrollParameters(imageList);
}


private void ShowScrollParameters(RasterImageList imageList)
{
   StringBuilder sb = new StringBuilder();
   sb.AppendFormat("Full Visible Rows: {0}{1}", imageList.FullVisibleRows, Environment.NewLine);
   sb.AppendFormat("Visible Rows: {0}{1}", imageList.VisibleRows, Environment.NewLine);
   sb.AppendFormat("Full Visible Columns: {0}{1}", imageList.FullVisibleColumns, Environment.NewLine);
   sb.AppendFormat("Visible Columns:{0}{1}", imageList.VisibleColumns, Environment.NewLine);
   sb.AppendFormat("TotalRows: {0}{1}", imageList.TotalRows, Environment.NewLine);
   sb.AppendFormat("TotalColumns: {0}{1}", imageList.TotalColumns, Environment.NewLine);
   sb.AppendFormat("TopIndex: {0}{1}", imageList.TopIndex, Environment.NewLine);
   MessageBox.Show(sb.ToString());
}
Requirements

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

See Also

Reference

RasterImageList Class
RasterImageList Members

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.