Using winforms in vs2008. I have a DataGridView and I would like to detect when the vertical scroll bar is visible. What event should I register for?
I am adding the
If your dgv is inside a panel then you can compare panel and dgv height properties. If dgv's is bigger than panel's then there must be a scrollbar, right?
Like :
int panel_height = pnl.Height;
int dgv_height = (dgv.RowCount + 1) * 24; // You can play around with this 24 according to your cell styles
if (dgv_height > panel_height) MessageBox.Show("Voila!");