I am using Silverlight 5 and C# to create a scroll bar.

I am have ListBox and I create a scrollbar and inside that scrollbar I display a List of items like this: (My code shows all the 7 items but I just want to display 3 items without scrolling rest 4 by scrolling)

```
        TextBlock txtblkShowStatus = null;
        ListBox lines = new ListBox();
        ScrollViewer scrollViewer = new ScrollViewer();
        scrollViewer.VerticalScrollBarVisibility = ScrollBarVisibility.Visible;
        lines.ItemsSource = param.Component.Attributes.Items;
        scrollViewer.Content = lines;
        scrollViewer.HorizontalAlignment = HorizontalAlignment.Center;
        scrollViewer.VerticalAlignment = VerticalAlignment.Center;
        scrollViewer.ScrollToVerticalOffset(3); //By this line i want to display the only 3 items (out of7).
       //I mean the other 4 items must be visible on scrolling.

        Grid.SetColumn(scrollViewer, 1);          
        childGrid.Children.Add(scrollViewer);

        txtblkShowStatus = generateTextBlock();
        lines.SelectionChanged += (o, e) =>
        {
            txtblkShowStatus.Text = lines.SelectedItem.ToString();
        };
        lines.SelectedIndex = 2; //It will display énd item in txtblkShowStatus when no clikc happens at starting.
        Grid.SetColumn(txtblkShowStatus, 2);
        childGrid.Children.Add(txtblkShowStatus); //This childGrid contain a row with 3 columns.

```

By this line scrollViewer.ScrollToVerticalOffset(3); i want to display only 3 items out of 7 .I mean the other 4 items must be visible on scrolling the scrollbar.

**NOTE: Please note that i don't have to use `height` , i need to deal with index because i will set the index statically and it must show just the values until that index and rest value will be displayed on scrolling.** (if you have anyother idea to achieve it please explain it).

How to do the achieve this?