How to detect the vertical scrollbar in a DataGridView control

后端 未结 7 688
半阙折子戏
半阙折子戏 2021-01-05 05:19

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

相关标签:
7条回答
  • 2021-01-05 05:59

    I think there´s no event for that... but you can try with something like this in all the places where the grid can grow:

    • Obtain the number of actual rows in the gridview + the header
    • Multiply that number by the height of each row
    • If the result is greater than the height of the DataGrid, there must be a vertical scrollbar.
    0 讨论(0)
提交回复
热议问题