Sign in to follow this  
Followers 0
burger

GUI listview help

3 posts in this topic

The following listview code works fine as long as the GUICtrlCreateLabel(_NowDate(),40,20) control line is commented out. If I uncomment this line, the listview control no longer works. What am I missing?

#include <Array.au3>
#include <File.au3>
;#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
;#include <Process.au3>
#include <Date.au3>

#Region ### START Koda GUI section ### Form=
GUICreate("FT Sigs", 465, 344, -1, -1)
GUICtrlCreateLabel(_NowDate(),40,20); <----------the problem
GUICtrlCreateListView ( "Name|RunDate|SigDate|NoDelaySignal|DelayedSignal|Delay", 30, 50, 400, 250, -1);, $LVS_EX_GRIDLINES )

Dim $aArray


For $nsig = 1 to 1;21
                If $nsig = 1 Then
                    $sigfile1 = "C:\ft\sig\tltt.sig"
                    $sigfile2 = "C:\ft\sig\tlt1.sig"
                    $Name = "tltr"
                ;$sig1 = "TecSig"
                ;$sig2 = "TecSig"
                EndIf
                
            ;_FileReadToArray($sigfile, $aArray)
            ;$sig1 = ($aArray[$aArray[0]-1])
                
                                _FileReadToArray($sigfile1, $aArray);Reads signal dates
                                $sig1 = ($aArray[$aArray[0]-1])
                                _FileReadToArray($sigfile2, $aArray)
                                $sig2 = ($aArray[$aArray[0]-1])
            ;_ArrayDisplay ( $aArray, "array")
                
                If StringLeft ($sig1, 1) = "S" Then $ss="Sell"
                If StringLeft ($sig1, 1) = "B" Then $ss="Buy"
                $Label1 = GUICtrlCreateListViewItem ( $Name & "|" & StringMid ($sig1, 3) & "|" & StringMid ($sig2, 3) &"|" & $ss, 3 )
                If StringLeft ($sig1, 1) = "S" Then
                    GUICtrlSetBkColor(-1, 0xFF0000)
                    $sig1 = "Sell"
                EndIf
                
                If StringLeft ($sig1, 1) = "B" Then
                    GUICtrlSetBkColor(-1, 0x00FF00)
                EndIf
    
Next

; GUI MESSAGE LOOP
GuiSetState()
While GuiGetMsg() <> $GUI_EVENT_CLOSE
WEnd

Share this post


Link to post
Share on other sites



That did it. Thank 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