Hello,
Welcome to Microsoft Q&A.
The drop-down list of a ComboBox
control is actual a Popup
control. You could view the structure of UIElements
of a ComboBox
control in the default style of the ComboBox
control.
You could try to adjust the position of the Popup
control in its opened event handler.
Please check the following steps:
a. Get the default style of ComboBox
control from generic.xaml
file and apply the style to your ComboBox
control.
b. Find the Popup
control in the added style, and add a Opened
event handler to it.
c. Use the following code to set the VerticalOffset
property of the Popup
control to adjust the position:
void winrt::BlankApp1::implementation::MainPage::Popup_Opened(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::Foundation::IInspectable const& e)
{
auto popup = sender.try_as<Windows::UI::Xaml::Controls::Primitives::Popup>();
popup.VerticalOffset(30);
}
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.