Jump to content

How to make listview show all data (like without "...")


 Share

Go to solution Solved by Danyfirex,

Recommended Posts

  • Solution

Look this example by M23

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

Global $aData[5] = ["1|1|1", "2|2222222222222|2", "33333333|3333|33333333333333", "4|444444444444444444444444444|4", "5|5|5"]
Global $aRet, $iMaxElement = 0, $iGUI_Width = 500

; Create GUI
Global $hGUI = GUICreate("Test", $iGUI_Width, 500)

; Create List View
Global $hListView = GUICtrlCreateListView(" | | ", 10, 10, 480, 480, $LVS_SHOWSELALWAYS, BitOR($LVS_EX_FULLROWSELECT, $WS_EX_CLIENTEDGE))
; Add data
For $i = 0 To 4
    GUICtrlCreateListViewItem($aData[$i], $hListView)
Next

; Determine ListView width
$iLV_Width = 0
For $i = 0 To 2
    GUICtrlSendMsg($hListView, $LVM_SETCOLUMNWIDTH, $i, $LVSCW_AUTOSIZE)
    $iLV_Width += GUICtrlSendMsg($hListView, $LVM_GETCOLUMNWIDTH, $i, 0)
Next

; resize ListView and GUI
ControlMove($hGUI, "", $hListView, 10, 10, $iLV_Width + 10, 480) ; Add 10 becasue of internal borders
WinMove($hGUI, "", Default, Default, $iLV_Width + 30) ; Add 30 for internal and external borders

GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

saludos

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...