ComponentOne Windows 7 Control Pack for WinForms
Working with Windows 7 Control Pack for WinForms / Working with C1TaskDialog / Access Keys
In This Topic
    Access Keys
    In This Topic

    An access key is an underlined character in the text of a menu, menu item, or the label of a control such as a button. With an access key, the user can "click" a button by pressing the ALT key in combination with the predefined access key. For example, if a button runs a procedure to print a form, and therefore its Text property is set to "Print," adding an ampersand before the letter "P" causes the letter "P" to be underlined in the button text at run time. The user can run the command associated with the button by pressing ALT+P. You cannot have an access key for a control that cannot receive focus.

    You can easily add access keys to buttons and command link buttons in a C1TaskDialog dialog box. To do so, you would need to set the button's Text property to a string that includes an ampersand (&) before the letter that will be the shortcut.

    Note: To include an ampersand in a caption without creating an access key, include two ampersands (&&). A single ampersand is displayed in the caption and no characters are underlined.

    See the Setting the Access Key topic for an example.