Jump to content

delete an element from combobox


Synthesis
 Share

Recommended Posts

How can I delete an element from a combobox?

I mean I have in the combo with the elements :

alfa
beta
gamma
delta

And I want to delete gamma.

The _GUICtrlComboBox_DeleteString doesn't work as I want. :|

Found out.. my mistake..

Edited by Nephentes
Link to comment
Share on other sites

Gamma item have index 2 (started form zero(alfa)), this works:

#include <GUIComboBox.au3>
#include <Constants.au3>
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 508, 91, 239, 158)
$Del = GUICtrlCreateButton("Delete item named as Gamma", 224, 24, 265, 33, $WS_GROUP)
$Combo1 = GUICtrlCreateCombo("", 8, 24, 209, 25)
GUICtrlSetData(-1, "alfa|beta|gamma|delta", "alfa")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $Del
                    _GUICtrlComboBox_DeleteString($Combo1, 2)
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

_____________________________________________________________________________

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...