Jump to content
Sign in to follow this  
nuki

ListView - Static Column Headers

Recommended Posts

nuki

hi guys! :)

sorry for the easy question, but i have problems with the new search engine or whatever, i cant find a solution...

i got a listview control, and some column headers made with _GUICtrlListView_AddColumn()

everythings working fine so far and i set the width of the column headers too, but when i add a listview item the column header auto sizes.

i need to know a way to be able to size the column headers by hand, but they should not change because of the new item input

i thought it might be a style or exstyle but i didnt found anything yet :<

(the resizing stuff wouldnt be a problem, but when the columns resize, a horizontal scroll pops out and that looks shit, maybe theres a way to disable the scroll thing too? ^^)

i hope you understand me and thanks for any help

marvin

Edited by nuki

Share this post


Link to post
Share on other sites
water

In my scripts I use

GUICtrlSendMsg($hGUIUserList, $LVM_SETCOLUMNWIDTH, 0, $LVSCW_AUTOSIZE_USEHEADER)

to set the column width to autosize (I got this code from this forum). Replace $LVSCW_AUTOSIZE_USEHEADER with the columnwidth in pixel.

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
nuki

hey

thanks for the answer

but its the same like _GUICtrlListView_SetColumnWidth or the _SendMessage command for that, i tried these all already and yours too

nothing works, only if i use the command AFTER i set the items... but it looks crappy if you add an item, because it goes autosized and then small again

i need something to keep the column headers static, something like a style

Share this post


Link to post
Share on other sites
water

Use _GUICtrlListView_BeginUpdate and _GUICtrlListView_EndUpdate to improve performance and to suppress displaying the ListView while the script is filling it.

_GUICtrlListView_BeginUpdate($hGUIUserList)
< ... Fill the ListView ... >
_GUICtrlListView_SetColumnWidth($hGUIUserList,0,150)
_GUICtrlListView_SetColumnWidth($hGUIUserList,1,250)
_GUICtrlListView_EndUpdate($hGUIUserList)
Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

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  

×