Jump to content

Recommended Posts

Posted

This is hurting my head. I've spent lots of time reading the helpfile, and looking at examples...All I'm looking to do is have a list that I can add or take away from, and save that list in a ini.

#include <GuiConstants.au3>
#include <GuiCombo.au3>

Opt('MustDeclareVars',1)

Dim $Combo, $Btn_Delete, $Btn_Exit, $msg, $Btn_Add, $gg

GuiCreate("ComboBox String", 392, 204)

$Combo = GuiCtrlCreateCombo("", 70, 10, 270, 110,$CBS_SIMPLE)
$Btn_Delete = GuiCtrlCreateButton("Delete String", 35, 120, 90, 30)
$Btn_Add = GuiCtrlCreateButton("Add String", 145, 120, 90, 30)
GUICtrlSetData($Combo,"B|C|D|E|F")
$Btn_Exit = GuiCtrlCreateButton("Exit", 255, 120, 90, 30)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE Or $msg = $Btn_Exit
            ExitLoop
        Case $msg = $Btn_Delete
            If(_GUICtrlComboGetCurSel($Combo) <> $CB_ERR) Then
                _GUICtrlComboDeleteString($Combo,_GUICtrlComboGetCurSel($Combo))
            EndIf
        Case $msg = $Btn_Add
            If(_GUICtrlComboGetCurSel($Combo) <> $CB_ERR) Then
                _GUICtrlComboAddString($Combo,$gg = _GUICtrlComboGetCurSel($Combo))
                GUICtrlSetData($Combo,$gg)
            endif
    EndSelect
WEnd
Exit
Posted

#include <GuiConstants.au3>
#include <GuiCombo.au3>

Opt('MustDeclareVars',1)

Dim $Combo, $Btn_Delete, $Btn_Exit, $msg, $Btn_Add, $gg

GuiCreate("ComboBox String", 392, 204)

$Combo = GuiCtrlCreateCombo("", 70, 10, 270, 110,$CBS_SIMPLE)
$Btn_Delete = GuiCtrlCreateButton("Delete String", 35, 120, 90, 30)
$Btn_Add = GuiCtrlCreateButton("Add String", 145, 120, 90, 30)
GUICtrlSetData($Combo,"B|C|D|E|F")
$Btn_Exit = GuiCtrlCreateButton("Exit", 255, 120, 90, 30)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE Or $msg = $Btn_Exit
            ExitLoop
        Case $msg = $Btn_Delete
            If(_GUICtrlComboGetCurSel($Combo) <> $CB_ERR) Then
                _GUICtrlComboDeleteString($Combo,_GUICtrlComboGetCurSel($Combo))
            EndIf
            Case $msg = $Btn_Add
                If GUICtrlRead($Combo) <> "" Then ConsoleWrite(_GUICtrlComboAddString($Combo,GUICtrlRead($Combo)) & @LF)
;~             If(_GUICtrlComboGetCurSel($Combo) <> $CB_ERR) Then
;~                 _GUICtrlComboAddString($Combo,$gg = _GUICtrlComboGetCurSel($Combo))
;~                 GUICtrlSetData($Combo,$gg)
;~             endif
    EndSelect
WEnd
Exit

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

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
×
×
  • Create New...