Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Listview column resizing


  • Please log in to reply
9 replies to this topic
Bugz000
  • Members
  • 155 posts
  • Last active: Oct 14 2015 01:03 PM
  • Joined: 24 Feb 2011

Hello there,

 

i have an issue using AutoHDR

 

if i use LV_ModifyCol() - the titles are cut short

 

10Of2.png

 

 

 

 

if i use Autohdr - LV_Modifycol("","autohdr"),  or even ;LV_Modifycol(autohdr)

10OfE.png

 

 

 

and if i manually resize them i get a horizontal scrollbar (in spite of just Gui, Show)

10OfS.png

 

 

 

now it states here:

 

AutoHdr: Adjusts the column's width to fit its contents and the column's header text, whichever is wider. If applied to the last column, it will be made at least as wide as all the remaining space in the ListView. It is usually best to apply this setting only after the rows have been added because that allows any newly-arrived vertical scroll bar to be taken into account when sizing the last column. This option has no effect when not in Report (Details) view.

 

so what is going wrong?


n39peTm.jpg
Hire me to write your code! (join IRC or PM me for details)


rbrtryn
  • Members
  • 1177 posts
  • Last active: Sep 11 2013 08:04 PM
  • Joined: 22 Jun 2011

If all parameters are omitted, the width of every column is adjusted to fit the contents of the rows

 
Have you tried it without parameters, i.e. LV_Modifycol()?
 

EDIT: Opps I see you did. Let me read the post again shy.png


My Scripts are written for the latest released version of AutoHotkey.

Need a secure, accessible place to backup your stuff? Use Dropbox!


Bugz000
  • Members
  • 155 posts
  • Last active: Oct 14 2015 01:03 PM
  • Joined: 24 Feb 2011

 
Have you tried it without parameters, i.e. LV_Modifycol()?

read my first post again


n39peTm.jpg
Hire me to write your code! (join IRC or PM me for details)


rbrtryn
  • Members
  • 1177 posts
  • Last active: Sep 11 2013 08:04 PM
  • Joined: 22 Jun 2011

After some coffee......grin.png

 

I think you have to tell it which column you are modifying:

 

LV_ModifyCol(1, "AutoHdr")

LV_ModifyCol(2, "AutoHdr")

 

So:

 

Loop 8
    LV_ModifyCol(A_Index, "AutoHdr")
 

My Scripts are written for the latest released version of AutoHotkey.

Need a secure, accessible place to backup your stuff? Use Dropbox!


Bugz000
  • Members
  • 155 posts
  • Last active: Oct 14 2015 01:03 PM
  • Joined: 24 Feb 2011

that worked but now shows a horizontal scroll bar
Loop 8
    LV_ModifyCol(A_Index, "AutoHdr")
gui, show


n39peTm.jpg
Hire me to write your code! (join IRC or PM me for details)


Bugz000
  • Members
  • 155 posts
  • Last active: Oct 14 2015 01:03 PM
  • Joined: 24 Feb 2011

bump


n39peTm.jpg
Hire me to write your code! (join IRC or PM me for details)


rbrtryn
  • Members
  • 1177 posts
  • Last active: Sep 11 2013 08:04 PM
  • Joined: 22 Jun 2011

The columns are going to expand as much as it takes to display the data, even if it is beyond the width of the ListView Control.

That's why you are getting the scrollbar. Maybe set a fixed width for the first column? The other columns don't seem to vary as much.


My Scripts are written for the latest released version of AutoHotkey.

Need a secure, accessible place to backup your stuff? Use Dropbox!


Bugz000
  • Members
  • 155 posts
  • Last active: Oct 14 2015 01:03 PM
  • Joined: 24 Feb 2011

is there not a way to have the listview control resize to acommodate?

GuiControl or even Controlmove has the ability to resize the control but not to auto size it sad.png - the data that is going into this can vary ALOT on size, hence why i'm wanting this to be 100% automatic


n39peTm.jpg
Hire me to write your code! (join IRC or PM me for details)


Bugz000
  • Members
  • 155 posts
  • Last active: Oct 14 2015 01:03 PM
  • Joined: 24 Feb 2011

bump-

 

seems i missed something - i had r20 w700 in the gui,add,listview line-

 

removing those made it very small - but at least it's not absolute- is there a way to make the control autosize?


n39peTm.jpg
Hire me to write your code! (join IRC or PM me for details)


Bugz000
  • Members
  • 155 posts
  • Last active: Oct 14 2015 01:03 PM
  • Joined: 24 Feb 2011

http://www.autohotke...-column-widths/ ripped the code apart from this to make a horrific code but it works perfectly

 

10Pzx.png


n39peTm.jpg
Hire me to write your code! (join IRC or PM me for details)