TanerJames Posted March 25, 2012 Share Posted March 25, 2012 hi, How to add two lines in a single row in listview? example: ---------------------------- data1 data1bbbb ---------------------------- i try @CRLF or chr(13) not support result data1data1bbbb thanks Link to comment Share on other sites More sharing options...
Andreik Posted March 25, 2012 Share Posted March 25, 2012 Well, it's listview so next line is another item. I'm affraid this is not possible. When the words fail... music speaks. Link to comment Share on other sites More sharing options...
JakeJohnson74 Posted January 14, 2015 Share Posted January 14, 2015 (edited) What is the alternative? Because I have a need for this. It doesn't have to be a ListView. I just want a control that will list multiple rows of data and to display their data in a single Element with multiple lines. Take a look a my Trello page Their web UI has a container, and inside that container they have single data elements stacked vertically, each displaying multiple pieces of info, various images etc. Edited January 14, 2015 by JakeKenmode Link to comment Share on other sites More sharing options...
jguinch Posted January 14, 2015 Share Posted January 14, 2015 You can create a simple list, so you just have to use GUICtrlSetData to set the data with "|" as separator for each element : GUICreate("GUI") GUICtrlCreateList("", 10, 10, 380, 380) GUICtrlSetData(-1, "row1|row2|row3") GUISetState() While GUIGetMsg() <> -3 Sleep(10) WEnd Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
JakeJohnson74 Posted January 14, 2015 Share Posted January 14, 2015 Thats a single control creating multiple single lines with a single SetData call. Thats no different than a for each calling SetData 3 times each time. Im talking about a control that contains a list of objects and each object has multiple params to display, so when clicked it selects the entire object that holds all of the smaller pieces of data. I need this because I am dragging and dropping the entire object and all of it's data onto another control where it will read all that data and create another object for the control it is dropped into. Picture dragging a triangle with information in it - into a new control, it reads the data, creates a square and populates it with that data. Same data - different object. Link to comment Share on other sites More sharing options...
TouchOdeath Posted January 15, 2015 Share Posted January 15, 2015 The only control that I know of that does that is a Edit control (I'm not versed in all the controls so...). You could drag whatever you wanted and just reparse it everytime. Its either that or create a custom control of your own Link to comment Share on other sites More sharing options...
JakeJohnson74 Posted January 15, 2015 Share Posted January 15, 2015 The only control that I know of that does that is a Edit control (I'm not versed in all the controls so...). You could drag whatever you wanted and just reparse it everytime. Its either that or create a custom control of your own Yup, that is where I was going Just feeling out the possibility of doing it with maybe some existing control or UDF control, no luck yet. Looks like its custom control to me as well at this point. I just resurrected this post from 2012 to see if there was anyone out there using something like this. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 15, 2015 Moderators Share Posted January 15, 2015 JakeKenmode,Here is a short script that might give you some pointers on how to create something along the lines you are looking for: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GUIScrollbars_Size.au3> Global $iDepth = 100 ; Depth of each element $iNext_Y = 0 ; Y coord of next element Global $aColour[3] = [0xFFCCCC, 0xCCFFCC, 0xCCCCFF] ; Colours to differentiate elements $iNext_Colour = 0 $iCount = 1 ; Index for next element Global $aScrollParams[4] = [0, 0, 0, 0] ; Placeholder for scroll size data ; Create GUI $hGUI = GUICreate("Test", 500, 220) ; Create menu $mFile = GUICtrlCreateMenu("File") $mFile_Exit = GUICtrlCreateMenuItem("Exit", $mFile) $mEdit = GUICtrlCreateMenu("Edit") $mEdit_Add = GUICtrlCreateMenuItem("Add", $mEdit) GUISetState() ; Determine GUI client depth $iClient_Depth = (WinGetClientSize($hGUI))[1] ; Register scroll handler GUIRegisterMsg($WM_VSCROLL, "_Scrollbars_WM_VSCROLL") ; Create and hide scrollbars _GUIScrollBars_Init($hGUI) _GUIScrollBars_ShowScrollBar($hGUI, $SB_HORZ, False) _GUIScrollBars_ShowScrollBar($hGUI, $SB_VERT, False) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $mFile_Exit Exit Case $GUI_EVENT_RESTORE _GUIScrollbars_Restore($hGUI, True, False) Case $mEdit_Add ; Scroll to start _GUIScrollBars_SetScrollInfoPos($hGUI, $SB_VERT, 0) ; Add next edit $cEdit = GUICtrlCreateEdit($iCount, 0, $iNext_Y, 480, $iDepth) GUICtrlSetBkColor($cEdit, $aColour[$iNext_Colour]) ; Increase for next addition $iCount += 1 $iNext_Y += 100 $iNext_Colour = Mod($iNext_Colour + 1, 3) ; If now over GUI client depth If $iNext_Y > $iClient_Depth Then ; Show vert scrollbar _GUIScrollBars_ShowScrollBar($hGUI, $SB_VERT, True) ; Determine and set required scroll parameters $aScrollParams = _GUIScrollbars_Size(0, $iNext_Y, 0, $iClient_Depth) _GUIScrollBars_SetScrollInfoPage($hGUI, $SB_VERT, $aScrollParams[2]) _GUIScrollBars_SetScrollInfoMax($hGUI, $SB_VERT, $aScrollParams[3]) EndIf ; Scroll to show new element _GUIScrollBars_SetScrollInfoPos($hGUI, $SB_VERT, $aScrollParams[3]) EndSwitch WEnd Func _Scrollbars_WM_VSCROLL($hWnd, $Msg, $wParam, $lParam) #forceref $Msg, $wParam, $lParam Local $nScrollCode = BitAND($wParam, 0x0000FFFF) Local $iIndex = -1, $yChar, $yPos Local $Min, $Max, $Page, $Pos, $TrackPos For $x = 0 To UBound($__g_aSB_WindowInfo) - 1 If $__g_aSB_WindowInfo[$x][0] = $hWnd Then $iIndex = $x $yChar = $__g_aSB_WindowInfo[$iIndex][3] ExitLoop EndIf Next If $iIndex = -1 Then Return 0 Local $tSCROLLINFO = _GUIScrollBars_GetScrollInfoEx($hWnd, $SB_VERT) $Min = DllStructGetData($tSCROLLINFO, "nMin") $Max = DllStructGetData($tSCROLLINFO, "nMax") $Page = DllStructGetData($tSCROLLINFO, "nPage") $yPos = DllStructGetData($tSCROLLINFO, "nPos") $Pos = $yPos $TrackPos = DllStructGetData($tSCROLLINFO, "nTrackPos") Switch $nScrollCode Case $SB_TOP DllStructSetData($tSCROLLINFO, "nPos", $Min) Case $SB_BOTTOM DllStructSetData($tSCROLLINFO, "nPos", $Max) Case $SB_LINEUP DllStructSetData($tSCROLLINFO, "nPos", $Pos - 1) Case $SB_LINEDOWN DllStructSetData($tSCROLLINFO, "nPos", $Pos + 1) Case $SB_PAGEUP DllStructSetData($tSCROLLINFO, "nPos", $Pos - $Page) Case $SB_PAGEDOWN DllStructSetData($tSCROLLINFO, "nPos", $Pos + $Page) Case $SB_THUMBTRACK DllStructSetData($tSCROLLINFO, "nPos", $TrackPos) EndSwitch DllStructSetData($tSCROLLINFO, "fMask", $SIF_POS) _GUIScrollBars_SetScrollInfo($hWnd, $SB_VERT, $tSCROLLINFO) _GUIScrollBars_GetScrollInfo($hWnd, $SB_VERT, $tSCROLLINFO) $Pos = DllStructGetData($tSCROLLINFO, "nPos") If ($Pos <> $yPos) Then _GUIScrollBars_ScrollWindow($hWnd, 0, $yChar * ($yPos - $Pos)) $yPos = $Pos EndIf Return $GUI_RUNDEFMSG EndFunc ;==>_Scrollbars_WM_VSCROLLYou will need my GUIScrollbars_Size UDF - look in my sig for the link. Please ask if you have any questions. M23 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