ControlDeleteItem throws an error.

Issue #74 closed
Winter Laite created an issue

Test code:

MyGui := Gui()
; ┌─────────────┐
;   Combo Box  
; └─────────────┘
ThirdText4 := MyGui.Add("Text", "x10 cBlue s10", "ComboBox")
MyCB := MyGui.Add("ComboBox", "x10 y+10 r10 -Limit", ["Orange","Purple","Fuchsia","Lime","Aqua"])

CB_Button := MyGui.Add("Button", "s8 x10 y+10", "Show CB Selection")
CB_AddBtn := MyGui.Add("Button", "s8 x140 yp", "Add 'Yellow' to CB")
CB_Button.OnEvent("Click", "CB_ButtonClicked")
CB_AddBtn.OnEvent("Click", "AddYellow")
CB_DeleteBtn := MyGui.Add("Button", "s8 h25 w80 x10 y+20", "Del Yellow")
CB_DeleteBtn.OnEvent("Click", "DeleteYellow")

MyGui.Show()

; ┌─────────────────────┐
;   ComboBox Callback  
; └─────────────────────┘

AddYellow() {
    ControlAddItem("Yellow", MyCB)
}

CB_ButtonClicked() {
    MsgBox(MyCB.Text, "CB Selection")
}

DeleteYellow() {
    ControlDeleteItem("Yellow", MyCB)
}

Error:

---> System.FormatException: Input string was not in a correct format.

Comments (4)

  1. Winter Laite reporter

    That makes me feel bad. I already had a test for deleting an item from a ListBox right above it in guitest.ahk, and didn’t duplicate it.

    Closing.

  2. Log in to comment