Sss
Sss

Reputation: 1529

How to add vertical scrollbar to combobox programatically

I am using silverlight and my combobox is like this:

ComboBox cb = new ComboBox();

Suppose it already contains Items which are visible only on clicking the combobox.

I want add a vertical scrollbar(or slider) programatically when it shows its items. Is there any inbuilt property for this in silverlight or do I need to use scrollbar or slider for it?

Upvotes: 0

Views: 15086

Answers (3)

paraJdox1
paraJdox1

Reputation: 973

You can go to Properties:

enter image description here

And set your specified height here.

Upvotes: 1

Adarsh Ravi
Adarsh Ravi

Reputation: 953

You can try changing the dropdownheight property.

cb.DropDownHeight = cb.ItemHeight * 5;

This is to view only 5 items at a time

Upvotes: 2

Nikhil Agrawal
Nikhil Agrawal

Reputation: 48568

There is an inbuilt property of ScrollViewer.VerticalScrollbarVisibility. Set its value to Visible.

For more read this

Upvotes: 2

Related Questions