c++ - 检查组合框是否打开
问题描述
如何检查组合框的下拉列表是否打开?(https://docs.microsoft.com/en-us/uwp/api/Windows.UI.Xaml.Controls.ComboBox?view=winrt-19041)
解决方案
You can subscribe the DropDownOpened event which will be triggered when you try to open the dropdown list or use IsDropDownOpen property to judge whether the drop-down portion of the ComboBox is currently open.
.xaml:
<ComboBox x:Name="MyComboBox" DropDownOpened="MyComboBox_DropDownOpened">
<ComboBoxItem>123</ComboBoxItem>
</ComboBox>
.cpp:
void AppCX::MainPage::Button_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
bool isOpen = MyComboBox->IsDropDownOpen;
}
void AppCX::MainPage::MyComboBox_DropDownOpened(Platform::Object^ sender, Platform::Object^ e)
{
}
推荐阅读
- ruby-on-rails - 是什么让 sidekiq 工作人员产生错误甚至不可能的方法响应
- spring-boot - 使用参数在 WebLogic 上运行的 Spring Boot 应用程序
- go - 如何使用 https 和 socks4 代理
- linux - 从远程会话中运行 ssh-copy-id 失败
- go - libswscale bad dst 图像指针 cgo
- vue.js - 在饼图底部显示最大值 - highcharts
- sql - 每天在 SQL 中获取汇总结果
- node.js - 来自 GKE 的 PubSub:PERMISSION_DENIED
- c# - 该代码仅创建最后一个复选框,我应该做些什么不同或添加?
- node.js - 使用 NodeJs 为 mocha 生成报告