While I was adding code to scroll event of a panel in c#, I found a strange behavior.
I have added a panel and inside the panel (auto-Scroll = true) there is a groupbox.
As shown below clicking the scroll moves scroll bar to a small distance.
At the same time, when I add a message box in the event to display a notification that a scroll has taken place, multiple message box are popping out.
Why is that?
I have already planned to add some logic when scrolling, but if it occurs multiple times then how it could be possible?
Here is the event handler:
private void panel1_Scroll_1(object sender, ScrollEventArgs e)
{
MessageBox.Show("ScrollBar is clicked");
}