Jump to content

Recommended Posts

Posted

Hello,

I have this table ;

$GUI = GUICreate("Windows Manager", 542, 497, 320, 120)
$ListView1 = GUICtrlCreateListView("", 16, 288, 505, 153)
GUISetState(@SW_SHOW)

Func _userInfoTable($UserId, $mail, $plan, $beginedate, $expiredate, $expire)
    ; Add columns

    _GUICtrlListView_InsertColumn($ListView1, 0, "USERID", 100)
    _GUICtrlListView_InsertColumn($ListView1, 1, "MAIL", 135)
    _GUICtrlListView_InsertColumn($ListView1, 2, "PLAN", 50)
    _GUICtrlListView_InsertColumn($ListView1, 4, "EXPIRE DATE", 135)
    GUICtrlSetBkColor(-1, $COLOR_RED)

        
    _GUICtrlListView_AddItem($ListView1, $UserId, 0)
    _GUICtrlListView_AddSubItem($ListView1, 0, $mail, 1, 1)
    _GUICtrlListView_AddSubItem($ListView1, 0, $plan, 2, 2)
    _GUICtrlListView_AddSubItem($ListView1, 0, $expire, 3, 3)
    
    $IntItemColor = $COLOR_BROWN
    GUICtrlSetBkColor($ListView1, $IntItemColor)
EndFunc

Please if u look you show BG color for item list.

 

Please how to add color to column name ?

 

TY

Posted

@AutoDEV :

Once again you post a code snippet which is not runnable. The function _userInfoTable(...) is not even called. In addition, your question itself is partly incomprehensible :(. What exactly do you mean by this :

39 minutes ago, AutoDEV said:

Please if u look you show BG color for item list.

If you are looking for help, then show at least a bit of effort.

For flexible ListViews try  @Melba23 's 

Example :

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#include "GUIListViewEx.au3"

$hGUI = GUICreate("Coloured ListView Example", 500, 300)

; Create ListView
$cLV = GUICtrlCreateListView("Column 0|Colourable|Column 2|Column 3", 10, 10, 480, 260, BitOR($LVS_SINGLESEL, $LVS_SHOWSELALWAYS))
For $i = 0 To 3
    _GUICtrlListView_SetColumnWidth($cLV, $i, 100)
Next

; Initiate ListView = user colours
$iLVIndex = _GUIListViewEx_Init($cLV, "", 0, 0, True, 32)

; Set default colours to use
Global $aDefCols[4] = ["0x000000", "0xFEFEFE", "0xFFFFFF", "0x0000FF"]
_GUIListViewEx_SetDefColours($iLVIndex, $aDefCols)

; If colours used then this function must be run BEFORE GUISetState
_GUIListViewEx_MsgRegister()

GUISetState()

; Create array and fill listview
Global $aLVArray[6][4]
For $i = 0 To 5
    $sData = "Item " & $i & "-0"
    $aLVArray[$i][0] = $sData
    For $j = 1 To 3
        $sData &= "|SubItem " & $i & "-" & $j
        $aLVArray[$i][$j] = "SubItem " & $i & "-" & $j
    Next
    _GUIListViewEx_InsertSpec($iLVIndex, 0, $sData)

    ; Some simple conditions for colour
    $sColSet = ";0x00FF00"
    If Mod($i, 2) = 0 Then
        $sColSet = ";0xFFFF00"
    ElseIf Mod($i, 3) = 0 Then
        $sColSet = ";0xFF0000"
    EndIf
    ; Set item colour
    _GUIListViewEx_SetColour($iLVIndex, $sColSet, 0, 1)
Next

While 1

    $iMsg = GUIGetMsg()
    Switch $iMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch

    $vRet = _GUIListViewEx_EventMonitor()

WEnd

 

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
×
×
  • Create New...