Jump to content

ListView - Static Column Headers


nuki
 Share

Recommended Posts

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
Link to comment
Share on other sites

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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...