-api-id | -api-type | ms.custom |
---|---|---|
T:Windows.UI.Xaml.Controls.DropDownButton |
winrt class |
RS5 |
Represents a button with a chevron intended to open a menu.
Equivalent WinUI 2 API for UWP: Microsoft.UI.Xaml.Controls.DropDownButton (for WinUI in the Windows App SDK, see the Windows App SDK namespaces).
<DropDownButton />
A DropDownButton is a button that shows a chevron as a visual indicator that it has an attached flyout that contains more options. It has the same behavior as a standard Button with a flyout; only the appearance is different.
For more info and examples, see Buttons.
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about modifying a control's style and template, see Styling controls. The default style, template, and resources that define the look of the control are included in the generic.xaml
file. For design purposes, generic.xaml
is available locally with the SDK or NuGet package installation.
- WinUI Styles (recommended): Use Microsoft.UI.Xaml.Controls.DropDownButton.
- Non-WinUI styles: For built-in styles, see
%ProgramFiles(x86)%\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP\<SDK version>\Generic\generic.xaml
.
Locations might be different if you customized the installation. Styles and resources from different versions of the SDK might have different values.
XAML also includes resources that you can use to modify the colors of a control in different visual states without modifying the control template. Modifying these resources is preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling section of the XAML styles article. Light-weight styling resources are available starting in Windows 10, version 1607 (SDK 14393).
Tip
For more info, design guidance, and code examples, see Buttons.
[!div class="nextstepaction"] Open the WinUI 2 Gallery app and see the DropDownButton in action
The WinUI 2 Gallery app includes interactive examples of most WinUI 2 controls, features, and functionality. Get the app from the Microsoft Store or get the source code on GitHub.