Basic Library for WPF and Silverlight | ComponentOne
WPF and Silverlight Edition Basic Library / Combo Box / ComboBox Features / Drop-Down List / Openingon Mouse Over
In This Topic
    Openingon Mouse Over
    In This Topic

    By default, the C1ComboBox control's drop-down list is only revealed when a user clicks the drop-down arrow. In this topic, you will write code that will cause the drop-down list to open whenever a user hovers over the control.

    Complete the following:

    1. In Design View, add x:Name="C1ComboBox1" to the <c1:C1ComboBox> tag so that the object will have a unique identifier for you to call in code.
    2. Click the C1ComboBox control to select it.
    3. In the Properties panel, click the Events button to reveal the control's list of events.
    4. Double-click inside of the MouseEnter text box. This will add the C1ComboBox_MouseEnter event handler to Code view.
    5. Add the following code to the C1ComboBox1_MouseEnter event handler:
    Visual Basic
    Copy Code
    C1ComboBox1.IsDropDownOpen = True
    

    C#
    Copy Code
    C1ComboBox1.IsDropDownOpen = true;
    
    1. Run the program. Hover over the C1ComboBox control with your cursor. Observe that the drop-down list appears when you hover over the control. The drop-down list will stay open until you either select an item or click outside of the control.