日期:2014-05-18 浏览次数:21062 次
this.panel1.Scroll += new System.Windows.Forms.ScrollEventHandler(this.panel1_Scroll);
this.panel2.Scroll += new System.Windows.Forms.ScrollEventHandler(this.panel1_Scroll);
       private void panel1_Scroll(object sender, ScrollEventArgs e)
        {
            if(e.ScrollOrientation == ScrollOrientation.VerticalScroll)
            {
                this.panel1.VerticalScroll.Value = e.NewValue;
                this.panel2.VerticalScroll.Value = e.NewValue;
            }
            if (e.ScrollOrientation == ScrollOrientation.HorizontalScroll)
            {
                this.panel1.HorizontalScroll.Value = e.NewValue;
                this.panel2.HorizontalScroll.Value = e.NewValue;
            }
            
        }
------解决方案--------------------