deparys Posted September 13, 2008 Share Posted September 13, 2008 In order to conserve column width, is it possible to have ListView column headings split over two or more lines? I have tried embedding @CRLF macros (e.g. GUICtrlCreateListView("Column 1 " & @CRLF & "heading | Column 2 " & @CRLF & "heading" ...) but this displays the headings on one line interspersed with small rectangular characters. Any suggestions? Link to comment Share on other sites More sharing options...
rasim Posted September 14, 2008 Share Posted September 14, 2008 deparys conserve column widthExample: expandcollapse popup#include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) Global Const $HDN_FIRST = -300 Global Const $HDN_ITEMCHANGINGA = $HDN_FIRST - 0 Global Const $HDN_ITEMCHANGINGW = $HDN_FIRST - 20 Global Const $HDN_BEGINTRACKA = $HDN_FIRST - 6 Global Const $HDN_BEGINTRACKW = $HDN_FIRST - 26 $GUI = GUICreate("Static Columns Demo!", 420, 240) GUISetOnEvent($GUI_EVENT_CLOSE, "Quit") $ListView = GUICtrlCreateListView("Column1|Column2", 20, 20, 380, 200, $LVS_NOSORTHEADER) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY_EVENTS") GUICtrlCreateListViewItem("Item 1|SubItem 1", $ListView) GUICtrlCreateListViewItem("Item 2|SubItem 2", $ListView) GUICtrlSendMsg($ListView, $LVM_SETCOLUMNWIDTH, 0, 80) GUICtrlSendMsg($ListView, $LVM_SETCOLUMNWIDTH, 1, 80) GUISetState(@SW_SHOW) While 1 Sleep(100) WEnd Func Quit() Exit EndFunc Func WM_NOTIFY_EVENTS($hWndGUI, $MsgID, $wParam, $lParam) Local $TagNMHDR = DllStructCreate("int;int;int", $lParam) If @error Then Return Local $iEvent = DllStructGetData($TagNMHDR, 3) If $iEvent = $HDN_BEGINTRACKA Or $iEvent = $HDN_BEGINTRACKW Or _ $iEvent = $HDN_ITEMCHANGINGA Or $iEvent = $HDN_ITEMCHANGINGW Then Return 1 Return $GUI_RUNDEFMSG EndFunc Link to comment Share on other sites More sharing options...
deparys Posted September 14, 2008 Author Share Posted September 14, 2008 (edited) Thanks for the reply rasim. I probably did not explain my question very well, but as a picture is probably worth a thousand words, here is an example (created with my graphics editor) of what I am trying to achieve: i.e. I would like the words in each column heading to appear on two or more lines withing the grey column heading. Edited September 14, 2008 by deparys Link to comment Share on other sites More sharing options...
kjuenke Posted October 27, 2015 Share Posted October 27, 2015 deparys, did you get a solution to your question? I want to do the same thing!Thanks! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 27, 2015 Moderators Share Posted October 27, 2015 kjuenke,Did you notice that the first post in this thread dates from over 7 years ago and that the OP has not been online since then?Please do not necro-post like this again - just open a new thread and link to the old one if it is absolutely necessary for understanding the problem. We ask you to do this for two main reasons:The language advances and the functionality might well be included in core or UDF code by nowThe changes in language syntax mean that it is likely that code from more than a couple of years ago may well not run under the current release interpreter without significant modification.M23 kjuenke 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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