How to scroll more than one check list box from verical scroll bar
Hi,
I have two check list box in a form. which is filled with data at runtime.
I want to put a common vertical scroll bar for both of the check list box.
Language used C# 2005
Any suggestion?
Thanks.
Prakash
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Danatas GerviRank #4,152 · 361 reputationPosted Jul 29, 2009, 10:57 PM EDT
May be MultiColumn = true mode may help?
Anyway, I found one way to do something, that "looks like" what you want:
namespace ScrollTwoLists { public partial class Form1 : Form { public Form1() { InitializeComponent(); this.checkedListBox1.SelectedValueChanged += new EventHandler(checkedListBox1_SelectedValueChanged); this.checkedListBox2.SelectedValueChanged += new EventHandler(checkedListBox2_SelectedValueChanged); } void checkedListBox2_SelectedValueChanged(object sender, EventArgs e) { if (this.checkedListBox2.SelectedIndex != this.checkedListBox1.SelectedIndex) { this.checkedListBox1.SetSelected(this.checkedListBox2.SelectedIndex, true); } } void checkedListBox1_SelectedValueChanged(object sender, EventArgs e) { if (this.checkedListBox2.SelectedIndex != this.checkedListBox1.SelectedIndex) { this.checkedListBox2.SetSelected(this.checkedListBox1.SelectedIndex, true); } } } }