如何将事件Key_Down添加到dotnetbar ribbon组合框

本文关键字:dotnetbar ribbon 组合 添加 Down 事件 Key | 更新日期: 2023-09-27 17:53:03

我用dotnetbar来设计UI。

private DevComponents.DotNetBar.ComboBoxItem AddressTextBox;

但是它没有Key_Down事件我使用

ComboBox address = (ComboBox)AddressTextBox.ContainerControl;
            address.KeyDown += new KeyEventHandler(address_KeyDown);

但是它有错误Unable to cast object of type 'DevComponents.DotNetBar.RibbonBar' to type 'System.Windows.Forms.ComboBox'.

任何想法?

如何将事件Key_Down添加到dotnetbar ribbon组合框

我猜AddressTextBox.ContainerControl没有保存类型的对象 System.Windows.Forms.ComboBox