【问题标题】:Check if combobox is opened检查组合框是否打开
【发布时间】:2020-10-12 21:04:51
【问题描述】:

【问题讨论】:

标签: c++ uwp c++-cx


【解决方案1】:

您可以订阅DropDownOpened当您尝试打开下拉列表时触发的事件或使用IsDropDownOpen属性判断ComboBox的下拉部分当前是否打开。

.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)
{

}

【讨论】:

    【解决方案2】:

    您可以使用IsDropDownOpen 属性。

    Definition
    
    Gets or sets a value that indicates whether the drop-down portion of the ComboBox is currently open.
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-14
      • 2015-02-14
      相关资源
      最近更新 更多