Jump to content
Sign in to follow this  
KaFu

[Solved] Listview in Tile mode - Height not correct

Recommended Posts

KaFu

HiHo Forum,

I've been playing around with Listview in Tile mode. Populating and switching style works fine, but (at least on the XP machine tested on) the tiles still seem to overlap. Row1 and Row2 look fine, but when you click Row3 you'll see that it overlaps with Row1.

Anyone :)? Maybe as a bonus question, how do I change to amount of tiles per row (I've not started to look into that)?

#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>
#include <WindowsConstants.au3>
#include <SendMessage.au3>
$GUI = GUICreate("ListView Example - Tile View", 400, 300)
$hListView = _GUICtrlListView_Create($GUI, "", 2, 2, 394, 268)
_GUICtrlListView_SetExtendedListViewStyle($hListView, BitOR($LVS_EX_DOUBLEBUFFER, $LVS_EX_FULLROWSELECT))
_GUICtrlListView_InsertColumn($hListView, 0, "Column 1", 100)
_GUICtrlListView_InsertColumn($hListView, 1, "Column 2", 100)
_GUICtrlListView_InsertColumn($hListView, 2, "Column 3", 100)
For $i = 0 To 2
_GUICtrlListView_AddItem($hListView, "Row " & $i + 1 & ": Col 1")
_GUICtrlListView_AddSubItem($hListView, $i, "Row " & $i + 1 & ": Col 2", 1)
_GUICtrlListView_AddSubItem($hListView, $i, "Row " & $i + 1 & ": Col 3", 2)
Next
_GUICtrlListView_SetView($hListView, 4)
; [url="http://msdn.microsoft.com/en-us/library/windows/desktop/bb774768(v=vs.85).aspx"]http://msdn.microsoft.com/en-us/library/windows/desktop/bb774768(v=vs.85).aspx[/url]
Global $tag_LVTILEVIEWINFO = "UINT cbSize;DWORD dwMask;DWORD dwFlags;STRUCT;LONG Size_cx;LONG Size_cy;ENDSTRUCT;INT cLines;STRUCT;LONG RECT_left;LONG RECT_top;LONG RECT_right;LONG RECT_bottom;ENDSTRUCT;"
$t_Struct2 = DllStructCreate($tag_LVTILEVIEWINFO)
DllStructSetData($t_Struct2, "cbSize", DllStructGetSize($t_Struct2))
#cs
Const LVTVIM_TILESIZE = &H00000001
Const LVTVIM_COLUMNS     = &H00000002
Const LVTVIM_LABELMARGIN = &H00000004
#ce
DllStructSetData($t_Struct2, "dwMask", BitOR(0x2, 0x4))
#cs
public const int LVTVIF_AUTOSIZE = 0;
public const int LVTVIF_FIXEDWIDTH = 1;
public const int LVTVIF_FIXEDHEIGHT = 2;
public const int LVTVIF_FIXEDSIZE = 3;
#endregion
#ce
DllStructSetData($t_Struct2, "dwFlags", 0)
DllStructSetData($t_Struct2, "Size_cx", 160) ; Width
DllStructSetData($t_Struct2, "Size_cy", 50) ; Height
DllStructSetData($t_Struct2, "cLines", 2) ; cLines
DllStructSetData($t_Struct2, "RECT_left", 1) ; Margin Left
DllStructSetData($t_Struct2, "RECT_top", 10) ; Margin Top
DllStructSetData($t_Struct2, "RECT_right", 1) ; Margin Right
DllStructSetData($t_Struct2, "RECT_bottom", 10) ; Margin Bottom
$p_Struct2 = DllStructGetPtr($t_Struct2)
; [url="http://msdn.microsoft.com/en-us/library/windows/desktop/bb761212(v=vs.85).aspx"]http://msdn.microsoft.com/en-us/library/windows/desktop/bb761212(v=vs.85).aspx[/url]
ConsoleWrite(_SendMessage($hListView, $LVM_SETTILEVIEWINFO, 0, $p_Struct2) & @CRLF)
For $iItem = 0 To 2
; [url="http://msdn.microsoft.com/en-us/library/windows/desktop/bb774766(v=vs.85).aspx"]http://msdn.microsoft.com/en-us/library/windows/desktop/bb774766(v=vs.85).aspx[/url]
Global $tag_LVTILEINFO = "UINT cbSize;INT iItem;UINT cColumns;PTR puColumns;" ;PTR piColFmt;"
$t_Struct = DllStructCreate($tag_LVTILEINFO)
DllStructSetData($t_Struct, "cbSize", DllStructGetSize($t_Struct)) ; cbSize
DllStructSetData($t_Struct, "iItem", $iItem) ; 0-based
DllStructSetData($t_Struct, "cColumns", 2) ; cColumns
$t_Struct_Cols = DllStructCreate("int;int")
DllStructSetData($t_Struct_Cols, 1, 2) ; show third column first
DllStructSetData($t_Struct_Cols, 2, 1) ; show second column last
DllStructSetData($t_Struct, "puColumns", DllStructGetPtr($t_Struct_Cols))
$p_Struct = DllStructGetPtr($t_Struct)
; [url="http://msdn.microsoft.com/en-us/library/windows/desktop/bb761210(v=vs.85).aspx"]http://msdn.microsoft.com/en-us/library/windows/desktop/bb761210(v=vs.85).aspx[/url]
ConsoleWrite(_SendMessage($hListView, $LVM_SETTILEINFO, 0, $p_Struct) & @CRLF)
Next
GUISetState()
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()

Regards

Edited by KaFu

Share this post


Link to post
Share on other sites
UEZ

Have a look here:

Maybe it will solve your problems.

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites
KaFu

Ah, I've seen that in the past, forgot it and reinvented the wheel :lol:.. thanks for the hint, but no, sadly it does not seem to work properly (on XP) with that UDF either.

Share this post


Link to post
Share on other sites
KaFu

Reordered the calls to

LVM_SETTILEVIEWINFO

_GUICtrlListView_SetView

LVM_SETTILEINFO

and now it works :)...

#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>
#include <WindowsConstants.au3>
#include <SendMessage.au3>

$GUI = GUICreate("ListView Example - Tile View", 400, 300)

$hListView = _GUICtrlListView_Create($GUI, "", 2, 2, 394, 268)
_GUICtrlListView_SetExtendedListViewStyle($hListView, BitOR($LVS_EX_DOUBLEBUFFER, $LVS_EX_FULLROWSELECT))

; Load images
$hImage = _GUIImageList_Create()
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0xFF0000, 16, 16))
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0x00FF00, 16, 16))
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0x0000FF, 16, 16))

_GUICtrlListView_SetImageList($hListView, $hImage, 1)
_GUICtrlListView_SetImageList($hListView, $hImage, 0) ; for Tile View

_GUICtrlListView_InsertColumn($hListView, 0, "Column 1", 100)
_GUICtrlListView_InsertColumn($hListView, 1, "Column 2", 100)
_GUICtrlListView_InsertColumn($hListView, 2, "Column 3", 100)

For $i = 0 To 19
    _GUICtrlListView_AddItem($hListView, "Row " & $i + 1 & ": Col 1", mod($i,3))
    _GUICtrlListView_AddSubItem($hListView, $i, "Row " & $i + 1 & ": Col 2", 1)
    _GUICtrlListView_AddSubItem($hListView, $i, "Row " & $i + 1 & ": Col 3", 2)
Next


; [url="http://msdn.microsoft.com/en-us/library/windows/desktop/bb774768(v=vs.85).aspx"]http://msdn.microsoft.com/en-us/library/windows/desktop/bb774768(v=vs.85).aspx[/url]
Global $tag_LVTILEVIEWINFO = "UINT cbSize;DWORD dwMask;DWORD dwFlags;STRUCT;LONG Size_cx;LONG Size_cy;ENDSTRUCT;INT cLines;STRUCT;LONG RECT_left;LONG RECT_top;LONG RECT_right;LONG RECT_bottom;ENDSTRUCT;"
$t_Struct2 = DllStructCreate($tag_LVTILEVIEWINFO)
DllStructSetData($t_Struct2, "cbSize", DllStructGetSize($t_Struct2))
#cs
    Const LVTVIM_TILESIZE    = &H00000001
    Const LVTVIM_COLUMNS    = &H00000002
    Const LVTVIM_LABELMARGIN = &H00000004
#ce
DllStructSetData($t_Struct2, "dwMask", 7)
#cs
    public const int LVTVIF_AUTOSIZE = 0;
    public const int LVTVIF_FIXEDWIDTH = 1;
    public const int LVTVIF_FIXEDHEIGHT = 2;
    public const int LVTVIF_FIXEDSIZE = 3;
    #endregion
#ce
DllStructSetData($t_Struct2, "dwFlags", 3)
DllStructSetData($t_Struct2, "Size_cx", 180) ; Width
DllStructSetData($t_Struct2, "Size_cy", 80) ; Height

DllStructSetData($t_Struct2, "cLines", 2) ; cLines

DllStructSetData($t_Struct2, "RECT_left", 10) ; Margin Left
DllStructSetData($t_Struct2, "RECT_top", 5) ; Margin Top
DllStructSetData($t_Struct2, "RECT_right", 10) ; Margin Right
DllStructSetData($t_Struct2, "RECT_bottom", 5) ; Margin Bottom
$p_Struct2 = DllStructGetPtr($t_Struct2)
; [url="http://msdn.microsoft.com/en-us/library/windows/desktop/bb761212(v=vs.85).aspx"]http://msdn.microsoft.com/en-us/library/windows/desktop/bb761212(v=vs.85).aspx[/url]
ConsoleWrite(_SendMessage($hListView, $LVM_SETTILEVIEWINFO, 0, $p_Struct2) & @CRLF)

_GUICtrlListView_SetView($hListView, 4)

For $iItem = 0 To 19
    ; [url="http://msdn.microsoft.com/en-us/library/windows/desktop/bb774766(v=vs.85).aspx"]http://msdn.microsoft.com/en-us/library/windows/desktop/bb774766(v=vs.85).aspx[/url]
    Global $tag_LVTILEINFO = "UINT cbSize;INT iItem;UINT cColumns;PTR puColumns;" ;PTR piColFmt;"
    $t_Struct = DllStructCreate($tag_LVTILEINFO)
    DllStructSetData($t_Struct, "cbSize", DllStructGetSize($t_Struct)) ; cbSize
    DllStructSetData($t_Struct, "iItem", $iItem) ; 0-based
    DllStructSetData($t_Struct, "cColumns", 2) ; cColumns
    $t_Struct_Cols = DllStructCreate("int;int")
    DllStructSetData($t_Struct_Cols, 1, 2) ; show third column first
    DllStructSetData($t_Struct_Cols, 2, 1) ; show second column last
    DllStructSetData($t_Struct, "puColumns", DllStructGetPtr($t_Struct_Cols))
    $p_Struct = DllStructGetPtr($t_Struct)
    ; [url="http://msdn.microsoft.com/en-us/library/windows/desktop/bb761210(v=vs.85).aspx"]http://msdn.microsoft.com/en-us/library/windows/desktop/bb761210(v=vs.85).aspx[/url]
    ConsoleWrite(_SendMessage($hListView, $LVM_SETTILEINFO, 0, $p_Struct) & @CRLF)
Next

_GUICtrlListView_SetColumnWidth($hListView, 0, $LVSCW_AUTOSIZE )

GUISetState()
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
Edited by KaFu

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  

  • Similar Content

    • Xandy
      By Xandy
      Special thanks: AdmiralAlkex, Melba23, MrCrearoR, Dragon Warrior 3, SDL
      MapIt is a tile world editor.  MapIt was built around the concept of reversing Dragon Warrior map images.  MapIt can take image input and produce a tile and world array.  
      Changing and replacing tile / world data is easy.  B/c tile world editor.

      CTRL+R in image above to signal replace tile action and I use "G" to Get the tile under mouse.
      A full list of hotkeys can be assigned in the: Help Menu\Hotkeys
       
      MapParser is a C++ project that scans images for unique tiles. 
      MapIt can be downloaded without MapParser. MapParser can be toggled off in the Scan_Image dialog. Without MapParser, MapIt will use the Scan_Tiles() function written in AutoIt ; which is 100 * slower Idk. If MapParser.exe will not run for you:      Installing Visual C++ Redistributable for Visual Studio 2015 should fix it: https://www.microsoft.com/en-us/download/details.aspx?id=48145   
      You can start with example world and tiles.
      Example world was made following these steps:
      Started with a tile map image of DragonWarrior3 town of: Reeve From MapIt World Menu \ New \ Scan_Image dialog, I set the area to exclude the key legend to the far right of image. After scanning the map image to world and tile array.  I removed a few of the map artifacts.  More work could be done on this world; removing unwanted tiles, but it is fine for now. I saved my world to disk.  This creates folder: Worldname: Containing folder of Tiles and a Worldname.txt. Using The Gimp, I edited some tiles to have a transparent color: Stairs, Trees, Desk Tables, Chest-of-drawers, Chairs, Signs, Doors, Beds. I changed the world layers to 2: World Menu \ Properties. F9 Finds all selected tile on current layer and changes to a new selected tile on new layer. I used F9 to change all Trees on layer: 0 to Trees on layer: 1. Then I used F9 to change all Trees on layer: 0 to Grass on layer: 0  
      In this video you can see how I used the Tile Menu \ Replace From Disk option to remap tile images to my custom tiles.  Conveniently my tiles already have a transparent pixel.
      See video for how that was done:
      To use the example world:
      First unzip the world save file: http://songersoft.com/programming/mapit/worlds/Reeve_Swapped.zip From the World Menu: choose \Load Navigate to the Reeve_Swapped.txt located in the extracted zip. Or you can scan any image.
      The map images I used are here: http://www.realmofdarkness.net/dq/games/nes/dw3/maps/world
      For download, videos, and example of created world file data; please visit the MapIt webpage: http://songersoft.com/programming/mapit/mapit_about.phtml
    • Broihon
      By Broihon
      Hey guys,

      I ran into a problem when I wanted to delete items of a listview using the delete key. My approach is to register my own WndProc for the listview and then filter the $WM_GETDLGCODE msg and then call the original WndProc.
      That works like a charm. The problem is that when the listview gets redrawn it somehow ends up in an infinite loop. The listview is suddenly emtpy and I can't interact with any controls of the GUI at all. Here's the code:
       
      #include <GUIConstantsEx.au3> #include <GUIListView.au3> #include <WinAPI.au3> $h_GUI = GUICreate("Test", 200, 200, 350, 350) $h_LV = GUICtrlCreateListView("Col 1|Col 2|Col 3", 0, 0, 200, 200) _GUICtrlListView_AddItem($h_LV, "") _GUICtrlListView_AddSubItem($h_LV, 0, "bla0", 0) _GUICtrlListView_AddSubItem($h_LV, 0, "bla0", 1) _GUICtrlListView_AddSubItem($h_LV, 0, "bla0", 2) _GUICtrlListView_AddItem($h_LV, "") _GUICtrlListView_AddSubItem($h_LV, 1, "bla1", 0) _GUICtrlListView_AddSubItem($h_LV, 1, "bla1", 1) _GUICtrlListView_AddSubItem($h_LV, 1, "bla1", 2) _GUICtrlListView_AddItem($h_LV, "") _GUICtrlListView_AddSubItem($h_LV, 2, "bla2", 0) _GUICtrlListView_AddSubItem($h_LV, 2, "bla2", 1) _GUICtrlListView_AddSubItem($h_LV, 2, "bla2", 2) _GUICtrlListView_AddItem($h_LV, "") _GUICtrlListView_AddSubItem($h_LV, 3, "bla3", 0) _GUICtrlListView_AddSubItem($h_LV, 3, "bla3", 1) _GUICtrlListView_AddSubItem($h_LV, 3, "bla3", 2) $h_LV_NewWndProc = DllCallbackRegister("WndProc_LV", "int", "hwnd;uint;wparam;lparam") $g_LV_OldWndProc = _WinAPI_SetWindowLong(GUICtrlGetHandle($h_LV), $GWL_WNDPROC, DllCallbackGetPtr($h_LV_NewWndProc)) GUISetState(@SW_SHOW) Func WndProc_LV($hWnd, $uMsg, $wParam, $lParam) Return _WinAPI_CallWindowProc($g_LV_OldWndProc, $hWnd, $uMsg, $wParam, $lParam) EndFunc ;==>WndProc_GUI Do Until GUIGetMsg() = $GUI_EVENT_CLOSE DllCallbackFree($h_LV_NewWndProc) As you can see I'm doing nothing in the WndProc of the listview. I'm simply calling the original WndProc. This still "freezes" when I mess with the width of the columns or in the original project when I add more items that they don't fit in the listview and I have to scroll. If I don't do that it's working fine.
    • c.haslam
      By c.haslam
      I have
      Local $idListview = GUICtrlCreateListView("",8,8,@DesktopWidth/2-16,@DesktopHeight-150,$LVS_SHOWSELALWAYS, _ $LVS_EX_INFOTIP) Local $hListView = GUICtrlGetHandle($idListview) _GUICtrlListView_InsertColumn($hListview, 0, "Filename", 400) _GUICtrlListView_InsertColumn($hListview, 1, "Ext", 50) _GUICtrlListView_InsertColumn($hListview, 2, "Size",70) _GUICtrlListView_InsertColumn($hListview, 3, 'Date time',100) _GUICtrlListView_InsertColumn($hListview, 4, "Path", 385) _GUICtrlListView_InsertColumn($hListview, 5, "sizeInt", 0) _GUICtrlListView_JustifyColumn($hListview, $kSize,1) ; right align then further on
      While True $sFnamExt = FileFindNextFile($iSrch) If @error Then ExitLoop EndIf $sAtts = FileGetAttrib($sPath&'\'&$sFnamExt) If StringInStr($sAtts,'D') Then If $sFnamExt<>'$RECYCLE.BIN' Then $sDirs &= '?'&$sPath&'\'&$sFnamExt EndIf Else $p = StringInStr($sFnamExt,'.',0,-1) ; last If $p=0 Then $sFnam = $sFnamExt $sExt = '' Else $sFnam = StringLeft($sFnamExt,$p-1) $sExt = StringTrimLeft($sFnamExt,$p) EndIf _GUICtrlListView_AddItem($hListview,$sFnam,-1,_GUICtrlListView_GetItemCount($hListview)+1000) _GUICtrlListView_AddSubItem($hListview,$nItem,$sExt,$kExt) $nSize = FileGetSize($sPath&'\'&$sFnamExt) $sSize = AddThousandsSeparator($nsize) _GUICtrlListView_AddSubItem($hListview,$nItem,$sSize,$kSize) _GUICtrlListView_AddSubItem($hListview,$nItem,$nsize,$kSizeInt) $nTotBytes += $nSize $a1 = FileGetTime($sPath&'\'&$sFnamExt,$FT_MODIFIED,$FT_ARRAY) $t = $a1[0]&'-'&$a1[1]&'-'&$a1[2]&' '&$a1[3]&':'&$a1[4] _GUICtrlListView_AddSubItem($hListview,$nItem,$t,$kDateTime) _GUICtrlListView_AddSubItem($hListview,$nItem,$sPath,$kPath) If $gSQL Then $s = "Insert into tbl values ("&_SQLite_Escape($sFnam)&","&_SQLite_Escape($sExt)&",'"& _ $sSize&"','"& _ $t&"',"&_SQLite_Escape($sPath)&","&$nSize&")" _SQLite_Exec(-1,$s) If @error Then MsgBox(0,@ScriptLineNumber,_SQLite_ErrMsg()) EndIf EndIf EndIf WEnd FileClose($iSrch) You will see that I heeded the advice in Help > _GUICtrlListView_AddItem: "As AutoIt uses the $iParam parameter to store the controlID of native-created ListView items, this value should be set sufficiently high for UDF-created items to avoid possible conflict with any existing controls - a starting value of 1000 is recommended."
      (It's unfortunate that the Example does not heed this advice. OK, it doesn't need to because there are no other controls, but still --- it would help neophytes if it did. Also to me _GUICtrlListView_AddItem is not native because it is a UDF. Confused?)
      My script then does a sort using SQLite, and updates the ListView:
      Local $hQuery Local $colNames = ['fnam','ext','nsize','dateTime','path','SizeInt'] Local $s = "Select * FROM tbl ORDER BY "&$colNames[$ncol]&';' _SQLite_Query(-1,$s, $hQuery) If @error Then MsgBox(0,@ScriptLineNumber,_SQLite_ErrMsg()) EndIf Local $aRow[$kSizeInt+1] Local $iItem=-1 While _SQLite_FetchData($hQuery, $aRow, False, False) = $SQLITE_OK ; Read Out the next Row If @error Then MsgBox(0,@ScriptLineNumber,_SQLite_ErrMsg()) EndIf $iItem += 1 For $i = $kFnam To $kSizeInt _GUICtrlListView_SetItem($hListview,$aRow[$i],$iItem,$i,Default) Next WEnd This works, but I had earlier coded
      _GUICtrlListView_SetItem($hListview,$aRow[$i],$iItem,$i,Default,$iItem+1000) because the same advice is in the Help for this function.
      So my care in specifying $param back-fired! What am I not understanding?
      The only difference in what works is that the $param parameter is defaulted.
    • FrancescoDiMuro
      By FrancescoDiMuro
      Good evening everyone
      I am building a management for the company I work with, and I just imported a real amount of rows ( about 29000 ), in my SQLite DB.
      The thing I am not understanding, is the time that the script takes to build this amount of rows in the ListView.
      I didn't measure it, but I think it took 2 minutes or so to create each ListView item...
      It is normal that it takes so much time?
      What can I do to improve the creation of the items?

      Here's the code I am using to query and to create ListView items...
      ; Articles ListView: Global $lvwArticles = GUICtrlCreateListView("ID|Fornitore|Codice|Descrizione|EU|Prezzo|Sconto Applicato|Note", 14, 87, 1507, 660, BitOR($GUI_SS_DEFAULT_LISTVIEW,$LVS_SORTASCENDING,$LVS_SORTDESCENDING), BitOR($WS_EX_CLIENTEDGE,$LVS_EX_GRIDLINES,$LVS_EX_FULLROWSELECT)) ; Query $strQuery = "SELECT * FROM ARTICOLI;" ; Query Execution _SQLite_GetTable2d($objDatabase, $strQuery, $arrResult, $intRows, $intColumns) If @error Then ; Error Handling Else ; Cleaning the ListView _GUICtrlListView_DeleteAllItems($lvwArticles) If @error Then ; Error Handling Else ; No records in the Table If UBound($arrResult) < 2 Then ; Error Handling Else _GUICtrlListView_BeginUpdate($lvwArticles) For $intCounter = 1 To UBound($arrResult) - 1 $strListViewItem = $arrResult[$intCounter][0] & "|" & _ $arrResult[$intCounter][1] & "|" & _ $arrResult[$intCounter][2] & "|" & _ $arrResult[$intCounter][3] & "|" & _ $arrResult[$intCounter][4] & "|" & _ $arrResult[$intCounter][5] & "|" & _ $arrResult[$intCounter][6] & "|" & _ $arrResult[$intCounter][7] $objListViewItem = GUICtrlCreateListViewItem($strListViewItem, $lvwArticles) Next _GUICtrlListView_EndUpdate($lvwArticles) EndIf EndIf EndIf Thanks in advance


      Best Regards.
    • Skysnake
      By Skysnake
      I am tracking this topic by @LarsJ.  It is very advanced and overkill for what I am currently trying to do.
       
      Problem is this.
      Listview contains columns, one of which is right aligned and gets populated by float values, such as 123.99.  Some do not have decimals ie 124.00 and on sort gets truncated to 124.  Its obviously still the same value, but the display has reset.
      ; line below is for list VIEW ;..................................0.........1......2............ $cListView = GUICtrlCreateListView("CUSTOMER|AMOUNT|DESCRIPTION", 8, 152, 764, 279) GUICtrlSetBkColor($cListView, $GUI_BKCOLOR_LV_ALTERNATE) ; alternate between the listview background color and the listview item background color GUICtrlSetBkColor($cListView, $LVStdClr) ; Set the background color for the listview _GUICtrlListView_SetColumnWidth($cListView, 0, 120) ; -- the client name _GUICtrlListView_SetColumnWidth($cListView, 1, 90) ;-- the amount _GUICtrlListView_JustifyColumn($cListView, 1, 1) ; 1 - Text is right aligned _GUICtrlListView_SetColumnWidth($cListView, 2, 200) ; the description What I am looking for is something native and simple like a 
          _GUICtrlListView_SetColumnFormat($cListView, 1, "%.2f") ;  1 - column is stringformatted to "%.2f"
      So that after each sort it will appear as it was in the original rendering.
      Is there something like this? I have not been able to find a simple solution.

      Thanks.
      Skysnake
×