Sign in to follow this  
Followers 0
Synthesis

delete an element from combobox

2 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
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

_____________________________________________________________________________

Share this post


Link to post
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
Sign in to follow this  
Followers 0