neogia Posted February 13, 2006 Share Posted February 13, 2006 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 Link to comment Share on other sites More sharing options...
GaryFrost Posted February 13, 2006 Share Posted February 13, 2006 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. Link to comment Share on other sites More sharing options...
neogia Posted February 13, 2006 Author Share Posted February 13, 2006 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now