Sign in to follow this  
Followers 0
bf2forlife

GUICtrlCreateListView?

3 posts in this topic

#1 ·  Posted (edited)

When my script tries to write on

$List1 = GUICtrlCreateListView ("SOMETHING        |",8,10,813,300)

Then it writes it on that at same place as SOMETHING, not in the white box. How i can fix this?

Here is the other code

GUICtrlSetData($List1, $string)
Edited by bf2forlife

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

When my script tries to write on

$List1 = GUICtrlCreateListView ("SOMETHING        |",8,10,813,300)

Then it writes it on that at same place as SOMETHING, not in the white box. How i can fix this?

Here is the other code

GUICtrlSetData($List1, $string)
GuiCtrlSetData() can only change an individual ListViewItem. Items are added With GuiCtrlCreateListViewItem(). If you add more items, save the control IDs to those items and you can change them individually with GuiCtrlSetData():
#include <GuiConstants.au3>

$hGUI = GUICreate("Test", 640, 480)
Global $avLVItems[10]
$avLVItems[0] = GUICtrlCreateListView("               ", 20, 20, 600, 390)
For $n = 1 To UBound($avLVItems) - 1
    $avLVItems[$n] = GUICtrlCreateListViewItem("Old Item " & $n, $avLVItems[0])
Next
$ctrlButton = GUICtrlCreateButton("CHANGE", 270, 430, 100, 30)
GUISetState()

$iChangeItem = 1
$iMultiplier = 2
While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $ctrlButton
            GUICtrlSetData($avLVItems[$iChangeItem], "New Item " & $iChangeItem * $iMultiplier)
            $iChangeItem += 1
            If $iChangeItem > UBound($avLVItems) - 1 Then 
                $iChangeItem = 1
                $iMultiplier += 1
            EndIf
    EndSwitch
WEnd

:)

P.S. The little square boxes inside your first item were there because you have hard Tabs in your text parameter. Use spaces instead to set the initial column width.

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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