DataGrid & ScrollBars

  • Thread starter Thread starter Angel Montesinos
  • Start date Start date
A

Angel Montesinos

I want to know when the scrollbars are moving.

I intend to use the protected propoerties VertScrollBar and HorizScrollBar
but these is not present in .NET CF.

Any sugerence?
 
I do this in an RDA sample that uses a DataGrid (ResultGrid is a DataGrid
instance; UpdateForm_ValueChanged is a handler declared in the form holding
the DataGrid):

-----

foreach ( Control c in ResultGrid.Controls )
{
Type t = c.GetType();
if ( typeof( System.Windows.Forms.HScrollBar ).IsAssignableFrom( t ) ||
typeof( System.Windows.Forms.VScrollBar ).IsAssignableFrom( t ) )
{
ScrollBar csb = (ScrollBar)c;

csb.ValueChanged += new EventHandler(UpdateForm_ValueChanged);

attachedToScrollBars = true;
}
}
 
Back
Top