I have code that frequently updates the contents of my DataGridView, by clearing the previous contents, and then re-filling the entire DataGridView with new rows of data. But if I click and hold on the scroll bar, I would like for it to NOT update the DataGridView while I am scrolling.
1: How do I detect that I am currently holding down the mouse button in a scroll operation?
What I tested so far:
The DataGridView.MouseDown event does NOT fire if I click on the scroll bar. It only fires if I click on some content within the DataGridView, but it ignores clicks on the actual scroll bar itself. Curiously though, the MouseEnter event DOES fire when I hover the scroll bar. But I don't see how I can tell whether I am scrolling or not, just by detecting a hover. I need to detect the MouseDown event on the scroll bar.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…