hi !
I have some text in 2 listboxes that I put in the panels of a splitContainer.
I want to scroll the text in the same time...verticaly and horizontaly, but I can't make this happen.
I tried using the properties of the splitContainer, but it doesn't works.The listbox properties are not helping.Can you help me please? 10q
Loading
Jan MontanoPosted Jan 9, 2009, 12:50 AM
splitContainer1.Panel1.Scroll += new ScrollEventHandler(Panel1_Scroll);
splitContainer1.Panel2.Scroll += new ScrollEventHandler(Panel2_Scroll);
void Panel2_Scroll(object sender, ScrollEventArgs e)
{
if (e.ScrollOrientation == ScrollOrientation.VerticalScroll)
{
splitContainer1.Panel1.VerticalScroll.Value = splitContainer1.Panel2.VerticalScroll.Value;
}
else if (e.ScrollOrientation == ScrollOrientation.HorizontalScroll)
{
splitContainer1.Panel1.HorizontalScroll.Value = splitContainer1.Panel2.HorizontalScroll.Value;
}
}
void Panel1_Scroll(object sender, ScrollEventArgs e)
{
if (e.ScrollOrientation == ScrollOrientation.VerticalScroll)
{
splitContainer1.Panel2.VerticalScroll.Value = splitContainer1.Panel1.VerticalScroll.Value;
}
else if (e.ScrollOrientation == ScrollOrientation.HorizontalScroll)
{
splitContainer1.Panel2.HorizontalScroll.Value = splitContainer1.Panel1.HorizontalScroll.Value;
}
}