Sign in to follow this  
Followers 0
anhchangtk

How add one string in Combo or more?

3 posts in this topic

As title, i want add one string in Combo or more. I had used two code is "_GUICtrlComboBoxEx_InsertString" and "_GUICtrlComboBoxEx_AddString" but when run code me click on Button1, Combo1 don't add line "Test" and "Inserted Text" :)

Please Help Me !!! :P

Below is my code:

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiComboBoxEx.au3>
#Region ### START Koda GUI section ### Form=
$Form1_1 = GUICreate("Form1", 214, 201, 192, 124)
$Combo1 = GUICtrlCreateCombo($Form1_1,"Combo1", 32, 16, 145, 25)
$Button1 = GUICtrlCreateButton("Button1", 72, 160, 75, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    If $nMsg = $button1 Then
        _GUICtrlComboBoxEx_AddString($Combo1,"Test")
        _GUICtrlComboBoxEx_InsertString ($Combo1, "Inserted Text", 1)
        EndIf
    If $nMsg = $GUI_EVENT_CLOSE Then Exit
WEnd

Thanks all everyone had read this topic :)

Share this post


Link to post
Share on other sites



There you go...

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiComboBoxEx.au3>
#Region ### START Koda GUI section ### Form=
$Form1_1 = GUICreate("Form1", 214, 201, 192, 124)
$Combo1 = GUICtrlCreateCombo("Combo1", 32, 16, 145, 25)
$Button1 = GUICtrlCreateButton("Button1", 72, 160, 75, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    If $nMsg = $button1 Then
        _GUICtrlComboBox_AddString($Combo1,"Test")
        _GUICtrlComboBox_InsertString ($Combo1, "Inserted Text", 1)
        EndIf
    If $nMsg = $GUI_EVENT_CLOSE Then Exit
WEnd

Instant Lockerz Invite - www.instantlockerzinvite.co.uk

Share this post


Link to post
Share on other sites

There you go...

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiComboBoxEx.au3>
#Region ### START Koda GUI section ### Form=
$Form1_1 = GUICreate("Form1", 214, 201, 192, 124)
$Combo1 = GUICtrlCreateCombo("Combo1", 32, 16, 145, 25)
$Button1 = GUICtrlCreateButton("Button1", 72, 160, 75, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    If $nMsg = $button1 Then
        _GUICtrlComboBox_AddString($Combo1,"Test")
        _GUICtrlComboBox_InsertString ($Combo1, "Inserted Text", 1)
        EndIf
    If $nMsg = $GUI_EVENT_CLOSE Then Exit
WEnd

OK Thanks you

only three words residual, damage all the code: D thanks you :)

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