ComponentOne ComboBox for ASP.NET: ComboBox for ASP.NET AJAX Task-Based Help > Adding Keyboard Accessibility Support to C1ComboBox

Adding Keyboard Accessibility Support to C1ComboBox

You can make C1ComboBox and each of its C1ComboBoxItems accessible through the keyboard by setting the AccessKey property.

Setting the access key using the C1ComboBox Editor

1.   Click the C1ComboBox smart tag to open the C1ComboBox Tasks menu.

2.   Select Edit Items and choose C1ComboBox1 in the ComboBox Editor. Note that you can also add keyboard access to each of the C1ComboBoxItems.

3.   Enter the desired letter next to the AccessKey property.

4.   Click OK to close the ComboBox Editor. When you run the project and press the ALT key (ALT + SHIFT if using Firefox) plus the letter key entered in the previous step, C1ComboBox1 gets the focus.

Setting the access key programmatically

Add the following code to your form:

      Visual Basic

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        C1ComboBox1.AccessKey = "M"

End Sub

      C#

protected void Page_Load(object sender, EventArgs e)

    {

        C1ComboBox1.AccessKey = "M";

    }


Send comments about this topic to ComponentOne.
Copyright © 1987-2010 ComponentOne LLC. All rights reserved.