Sign in to follow this  
Followers 0
Kogmedia

Problem : ListView set Set Coloum Width with ini?

3 posts in this topic

#1 ·  Posted (edited)

Hello,

I can't get this to work it makes the coloums it resizes but doesn't resize the listview correctly

I.E

COL0=82 : RESIZED 6

COL1=341 : RESIZED 12

COL2=72 : RESIZED 12

COL3=46 : RESIZED 12

COL4=68 : RESIZED12

COL5=46 : RESIZED 12

The console gives me the right sizes

82

341

72

46

68

46

settings.ini

[GUI]
COL0=82
COL1=341
COL2=72
COL3=46
COL4=68
COL5=46

#include <GUIConstants.au3>
#include <GuiListView.au3>
$Form1 = GUICreate("TEST", 633, 454, 197, 115)
$List1 = GUICtrlCreateListView("COL0|COL1|COL2|COL3|COL4|COL5", 8, 16, 617, 409)
GUISetState(@SW_SHOW)
For $x = 0 To 5
    $COL = IniRead("settings.ini","GUI","COL"&$x,100)
    ConsoleWrite(@CRLF&$COL)
    _GUICtrlListViewSetColumnWidth ( $List1, $x, $COL )
    MsgBox(0,"COL"&$x,"Width : "&_GUICtrlListViewGetColumnWidth ($List1, $x))
Next

While 1
$msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    EndSelect
WEnd
Edited by Kogmedia

[font="Verdana"]Keith (Kogmedia)[/font]My ScriptQuick Search - Internet / Hard Drive Search

Share this post


Link to post
Share on other sites



Hello,

I can't get this to work it makes the coloums it resizes but doesn't resize the listview correctly

Everything read out of an .ini is a string. Convert it to a number first with Number():

_GUICtrlListViewSetColumnWidth ($List1, $x, Number($COL))

Some AutoIt functions gracefully convert a string of a number to the number, but evidently _GuiCtrlListViewSetColumnWidth() is not one of them.

:rolleyes:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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  
Followers 0