Jump to content

Reload ListView Flicker


Recommended Posts

With a function like this i need to reload the whole ListView to get the new values from a database with this i empty the whole ListView and repopulate it like the code below, is there an easier way to do this or some solution to the flickering?

Func _loadUsersListbox()
        _GUICtrlListView_DeleteAllItems($ListView1)
        $var = _Query($sql, "SELECT * FROM sup_users")
        With $var
            While Not .EOF
                $SQL_USR = .Fields("User_Name" ).value
                $SQL_EXT = .Fields("User_Ext" ).value
                $SQL_STA = .Fields("User_Status" ).value
                $SQL_NUM = .Fields("User_Number" ).value
                $listbox_sql_update = $SQL_USR & "|" & $SQL_EXT & "|" & $SQL_STA
                $item1 = GUICtrlCreateListViewItem($listbox_sql_update, $ListView1)
                If $SQL_STA = "LINE BUSY" Then
                    GUICtrlSetBkColor($item1, $iListofflineColor)
                ElseIf $SQL_STA = "AVAILABLE" Then
                    GUICtrlSetBkColor($item1, $iListreadyColor)
                EndIf
                .MoveNext
            WEnd
        EndWith
EndFunc  ;==>_loadUsersListbox
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...