Jump to content
Sign in to follow this  
au3scr

Need ListView help

Recommended Posts

au3scr

How i can make ListView wider? I want ListView width as longest list element.I have no idea how to explain so I added pictures here.

Now it looks like:

Posted Image

but i want to make ListView wide as longest item in list so I can get rid of ... at the end of line and I can fully see window title in list.

I want it to look like this:

Posted Image

#include <guiconstants.au3>
#include <File.au3>
#include <String.au3>
#include <GuiEdit.au3>
#include <Process.au3>



GUICreate("Window mannager", 320, 400)
$List1 = GUICtrlCreateListView ( "windows", 3,3,314,180)
$var = WinList()
For $i = 1 to $var[0][0]
  ; Only display visble windows that have a title
  If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then
    GUICtrlCreateListViewItem($var[$i][0] , $List1)
  EndIf
Next
GUICtrlCreateInput("",3,183,314,20)

GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
;### Tidy Error -> "endswitch" is closing previous "case"
        EndSwitch
;### Tidy Error -> "wend" is closing previous "switch"
    WEnd






Func IsVisible($handle)
  If BitAnd( WinGetState($handle), 2 ) Then 
    Return 1
  Else
    Return 0
  EndIf

EndFunc

Thanks for everyone who can help me.


Share this post


Link to post
Share on other sites
Nahuel

Try this:

$List1 = GUICtrlCreateListView ( "windows", 3,3,314,180)
        _GUICtrlListView_SetColumnWidth($List1,0,300);300 is the width of the 0th column. Change it to whatever you want

Share this post


Link to post
Share on other sites
Madza91

Or:

$List1 = GUICtrlCreateListView ( "windows", 3,3,314,180)
GUICtrlSendMsg(-1, 0x101E, 0, 300)

[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Share this post


Link to post
Share on other sites
au3scr

0x101E - What that mean?


Share this post


Link to post
Share on other sites
Madza91

Is improtant what that mean? important is that works... ;)

Btw, u can use Koda form designer and u will see in options answer for your question ;D


[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Share this post


Link to post
Share on other sites
rasim

n3nE

Is improtant what that mean?

Always, for me! ;)

au3scr

Its mean a LVM_SETCOLUMNWIDTH message.

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  

×