Jump to content

ListView Change text Colour not working for me


 Share

Recommended Posts

I have tried several way sto get this to work to no avail. Any help would be appreciated.

#include <ListViewConstants.au3>
#include <GuiListView.au3>
#include "GuiListViewEx.au3"


$idItem = GUICtrlCreateListViewItem($r & " | " & $c & $adoRs.Fields("TransactionAmount").value & " | " & $Timestamp & " | "  &  _StringProper($adoRs.Fields("Tillid").value)  &  @CRLF &  @CRLF & "Card Number : " &  $cardnum & " " , $idListView)
                ConsoleWrite( "IDITEM" & $idItem)
                If  STRINGLEFT($adoRs.Fields("TransactionAmount").value,1)= "-"  Then
                      Consolewrite(" String is Negative" & @CRLF) ;Drops in Here as expected 
                     ;GUICtrlSetColor(-1, $COLOR_RED) ; Colour line if item is negative this didn' work
                 $TxC= _GUICtrlListView_SetTextColor($hListView, $CLR_RED) ; I also tried  $TxC= _GUICtrlListView_SetTextColor(-1, 0xFF0000)
                  CONSOLEWRITE("TEXTCOLOUR RETURNED " & $TxC & @crlf) ; This is returning True
                ELSE
                  Consolewrite(" String is NOT Negative" & @CRLF)
                EndIf

 

Link to comment
Share on other sites

  • Moderators

@Ambient posting non-runnable code is not going to help us help you; especially with a number of variables for which we have no context. Please post at least a reproducer that shows the behavior you're encountering.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
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
 Share

×
×
  • Create New...