Jump to content
Sign in to follow this  
neogia

Help with styles for ListView

Recommended Posts

neogia

I want to create a ListView box that will automatically adjust the columns to accommodate the data. I read something about $LVSCW_AUTOSIZE in the beta helpfile in relation to GUIListView.au3. I haven't, however, figured out how to implement it. Here's my ListView box declaration:

$scriptListView = GUICtrlCreateListView("Script|Progress", 10, 525, 280, 125, $LVSCW_AUTOSIZE)

This is probably pretty obviously wrong to some of you, but I couldn't find any information on how to utilize styles in the helpfile. In addition to the answer to this question, could someone post some info on how to use styles? Thanks.


[u]My UDFs[/u]Coroutine Multithreading UDF LibraryStringRegExp GuideRandom EncryptorArrayToDisplayString"The Brain, expecting disaster, fails to find the obvious solution." -- neogia

Share this post


Link to post
Share on other sites
GaryFrost

I want to create a ListView box that will automatically adjust the columns to accommodate the data. I read something about $LVSCW_AUTOSIZE in the beta helpfile in relation to GUIListView.au3. I haven't, however, figured out how to implement it. Here's my ListView box declaration:

$scriptListView = GUICtrlCreateListView("Script|Progress", 10, 525, 280, 125, $LVSCW_AUTOSIZE)

This is probably pretty obviously wrong to some of you, but I couldn't find any information on how to utilize styles in the helpfile. In addition to the answer to this question, could someone post some info on how to use styles? Thanks.

Create the Listview

then using

_GUICtrlListViewSetColumnWidth($h_listview, $i_col, $i_width)

from the GuiListView.au3 include replace the $i_width with $LVSCW_AUTOSIZE

for example to autosize the 1st column (index 0)

_GUICtrlListViewSetColumnWidth($h_listview, 0,$LVSCW_AUTOSIZE)


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites
neogia

Create the Listview

then using

_GUICtrlListViewSetColumnWidth($h_listview, $i_col, $i_width)

from the GuiListView.au3 include replace the $i_width with $LVSCW_AUTOSIZE

for example to autosize the 1st column (index 0)

_GUICtrlListViewSetColumnWidth($h_listview, 0,$LVSCW_AUTOSIZE)

Oh, I see. I mistook $LVSCW_AUTOSIZE to be a style, when in reality, it's not a constant, but a variable that contains the largest width required by data in the column, correct? In any case, this works just fine:

_GUICtrlListViewSetColumnWidth($scriptListView, 0, $LVSCW_AUTOSIZE)

when called after I add a script to the ListView box. Thanks again, gafrost.


[u]My UDFs[/u]Coroutine Multithreading UDF LibraryStringRegExp GuideRandom EncryptorArrayToDisplayString"The Brain, expecting disaster, fails to find the obvious solution." -- neogia

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.