c# – C # Winforms scrolling ComboBox

Question:

How to prevent scrolling in a ComboBox when the cursor is over it and at the same time keep scrolling the main form . The fact is that when I select items, labels are created for me and this is not very convenient when, when scrolling the main content, the mouse cursor accidentally falls on the ComboBox.

private void comboBox1_MouseWheel(object sender, MouseEventArgs e)
{ 
     ((HandledMouseEventArgs)e).Handled = true; 
     // Прокручивать главную форму...
}

Answer:

Try this.OnMouseWheel (e)

private void comboBox1_MouseWheel(object sender, MouseEventArgs e)
{ 
     ((HandledMouseEventArgs)e).Handled = true; 
     this.OnMouseWheel(e)
}
Scroll to Top