Back to Devexpress

ComboBoxEdit.GetPopupEditForm() Method

windowsforms-devexpress-dot-xtraeditors-dot-comboboxedit-87fafbf4.md

latest4.2 KB
Original Source

ComboBoxEdit.GetPopupEditForm() Method

Returns the control’s popup window.

Namespace : DevExpress.XtraEditors

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
public ComboBoxPopupListBoxForm GetPopupEditForm()
vb
Public Function GetPopupEditForm As ComboBoxPopupListBoxForm

Returns

TypeDescription
DevExpress.XtraEditors.Popup.ComboBoxPopupListBoxForm

A DevExpress.XtraEditors.Popup.ComboBoxPopupListBoxForm object that represents the control’s popup window. null ( Nothing in VB) if the popup window has not been opened yet.

|

Remarks

At runtime, the control’s popup window can be opened with a click on the control’s dropdown button, or in code using the PopupBaseEdit.ShowPopup method. After the popup window has been opened for the first time, you can use the GetPopupEditForm method to get access to the popup window object. If the popup window has not been opened yet, the GetPopupEditForm returns null ( Nothing in VB). Typically, you will be calling the GetPopupEditForm method in the PopupBaseEdit.Popup event handler to get access to the popup window after it has been opened. In the event handler, you can adjust the popup window settings, or handle its events. See the code below.

csharp
private void comboBoxEdit1_Popup(object sender, EventArgs e) {
    DevExpress.XtraEditors.ComboBoxEdit edit = sender as DevExpress.XtraEditors.ComboBoxEdit;
    if (edit != null){
        DevExpress.XtraEditors.Popup.ComboBoxPopupListBoxForm popupForm = edit.GetPopupEditForm();
        // ... 
    }
}
vb
Private Sub ComboBoxEdit1_Popup(sender As Object, e As EventArgs) Handles ComboBoxEdit1.Popup
    Dim edit As DevExpress.XtraEditors.ComboBoxEdit = TryCast(sender, DevExpress.XtraEditors.ComboBoxEdit)
    If edit IsNot Nothing Then
        Dim popupForm As DevExpress.XtraEditors.Popup.ComboBoxPopupListBoxForm = edit.GetPopupEditForm()
        ' ...
    End If
End Sub

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GetPopupEditForm() method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-combobox-hide-specific-items/CS/MyComboBoxEdit/ComboBoxHideItemsHelper.cs#L44

csharp
private void RefreshPopup() {
    ComboBoxPopupListBoxForm popupForm = _comboBox.GetPopupEditForm();
    if (popupForm != null) {

winforms-combobox-hide-specific-items/VB/MyComboBoxEdit/ComboBoxHideItemsHelper.vb#L54

vb
Private Sub RefreshPopup()
    Dim popupForm As ComboBoxPopupListBoxForm = _comboBox.GetPopupEditForm()
    If popupForm IsNot Nothing Then

See Also

Popup

ComboBoxEdit Class

ComboBoxEdit Members

DevExpress.XtraEditors Namespace