Question

I have ribbon tabs, and there are buttons, textboxes,comboboxes in each tab. My problem is, I want to be able to scroll down and up with my mouse wheel (for the combobox), but instead, my mouse wheel changes the tabs. It doesn't affect the combobox in it. Is there a way to fix this? It is really annoying.

Was it helpful?

Solution

Too long for a comment, so I will post it here.

Try creating your own class that inherits from that Ribbon control. I don't have a ComponentOne library, so for this example, I am just calling the control "Ribbon":

public class MyRibbon : Ribbon {

  public bool DisableMouseWheel { get; set; }

  protected override void OnMouseWheel(MouseEventArgs e) {
    if (!this.DisableMouseWheel) {
      base.OnMouseWheel(e);
    }
  }
}

Rebuild your solution. Click on the "Show All Files" button from the Solution Explorer and open your designer file for your form. There should be two lines in the file that reference your Ribbon type, replace the type with your new MyRibbon class.

Now subscribe to the ComboBox's Enter and Leave events where you change the DisableMouseWheel property.

Make a backup of your work before trying this.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top