Jump to content
Sign in to follow this  
ileandros

GuiCtrlSetData()

Recommended Posts

ileandros

Hello,

I have 2 listobox. The first one is filled with items and the second one is empty.

I want to set the data of the second list and make it copie the first list when i press the button.

i tried this but i got a issue.

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 590, 380, 192, 124)
$Button1 = GUICtrlCreateButton("All", 256, 168, 75, 25)
$List1 = GUICtrlCreateList("", 48, 40, 185, 305)
GUICtrlSetData(-1,"Item1|item2|item3")
$List2 = GUICtrlCreateList("", 360, 48, 185, 292)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
  Case $GUI_EVENT_CLOSE
   Exit
  Case $Button1
   GUICtrlSetData($List2,$List1)
EndSwitch
WEnd
Edited by ileandros

I feel nothing.It feels great.

Share this post


Link to post
Share on other sites
wakillon

Try this :oops:

#include <GUIListBox.au3>

$Form1 = GUICreate("Form1", 590, 380, 192, 124)
$Button1 = GUICtrlCreateButton("All", 256, 168, 75, 25)
$List1 = GUICtrlCreateList("", 48, 40, 185, 305)
GUICtrlSetData(-1,"Item1|item2|item3")
$List2 = GUICtrlCreateList("", 360, 48, 185, 292)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            Local $_Text =''
            For $_I = 0 To _GUICtrlListBox_GetCount ( $List1 ) -1
                 $_Text &= _GUICtrlListBox_GetText ( $List1, $_I ) & '|'
            Next
            GUICtrlSetData($List2, $_Text )
    EndSwitch
WEnd

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

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  

×