two HScrollbars, scroll simultaneaously

  • Thread starter Thread starter jjj
  • Start date Start date
J

jjj

hi,

I have two HScrollBars, when either one scrolls, the other will also
scrolls.

How can this be done.

Thanks.
 
* "jjj said:
I have two HScrollBars, when either one scrolls, the other will also
scrolls.

\\\
Private Sub HScrollBar1_Scroll(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs) Handles HScrollBar1.Scroll
Me.HScrollBar2.Value = Me.HScrollBar1.Value
End Sub
///
 
hi,

Actually, I asked the wrong question. What I really want to know is, that
say I have 2 datagrid, if I scroll either grid, it will cause the other to
scroll as well. if I subscribe scroll event to these two datagrid, it will
cause circular events.

Thanks.
 
jjj said:
hi,

Actually, I asked the wrong question. What I really want to know is, that
say I have 2 datagrid, if I scroll either grid, it will cause the other to
scroll as well. if I subscribe scroll event to these two datagrid, it will
cause circular events.

Thanks.

So use own boolean variable do defend raise events circular:
if (!isScrolling){
isScrolling=true;
// scroll second grid
isScrolling=false;
}
 
Back
Top