如何将Auto Mouse Scroll和Mouse hover属性的属性设置为UltraDropdown?

时间:2012-03-29 06:43:00

标签: drop-down-menu

我使用UltraDropDown控件绑定一个UltraGrid控件的列,以列表格式列出People类别。

这个下拉控件有超过25个项目,显示8个类别Max,非常好。现在每当我点击下拉控件查看所有人类别列表时,我必须按住滚动条并向下拖动以查看所有类别。但是我想在鼠标滚动时显示所有类别,它会自动向上和向下移动以显示所有类别,还有一件我想要的东西,当我将鼠标悬停在列出的类别上时,悬停项目应该是阴影或彩色。

请帮助解决这两个主题。

谢谢&问候, Shashi Bhushan Jaiswal enter image description here

1 个答案:

答案 0 :(得分:0)

我认为第一个要求默认为行为。您是否因此无法处理MouseWheel事件?

以下是您的第二个要求的代码,但我不知道您是否喜欢使用MouseHover事件,但这是您的要求:

    void ultraDropDown1_MouseHover(object sender, EventArgs e)
    {
        if (cell != null && isInItem) {cell.Cell.Appearance.BackColor = Color.Red;}
    }

    CellUIElement cell;
    bool isInItem = false;
    private void ultraDropDown1_MouseEnterElement(object sender, Infragistics.Win.UIElementEventArgs e)
    {
        if (e.Element is EditorWithTextDisplayTextUIElement && e.Element.Parent.Parent is CellUIElement)
        {
            cell = (CellUIElement)e.Element.Parent.Parent;
            isInItem = true;
        }
        else isInItem = false;
    }