kamuline Posted March 20, 2017 Share Posted March 20, 2017 (edited) Hi I try to use some input boxes in a listview, but the default value is only visible if i click inside the box, and it disappears if i click somewhere else. Is there anything i can do about it. Thx for the help #include <GUIConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <ButtonConstants.au3> #include <WindowsConstants.au3> #include <Guilistview.au3> #include <EditConstants.au3> #include <File.au3> $gui = GUICreate("Order", 210, 300, -1, -1) Global $List = GUICtrlCreateListView("", 1, 1, 204, 300,-1,BitOR($LVS_EX_GRIDLINES, $LVS_EX_CHECKBOXES)) GUISetState() _Fill() While 1 $msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _Fill() Dim $Materials[5] = ["mat 1", "mat 2", "mat 3", "mat 4", "mat 5"] _GUICtrlListView_AddColumn($List,"Materials",100) _GUICtrlListView_AddColumn($List,"Quantity",100) Dim $aInput[UBound($Materials)] For $i = 1 To UBound($Materials) _GUICtrlListView_AddItem($List, $Materials[$i-1]) $aInput[$i-1] = GUICtrlCreateInput("1", 105, 4 + (17 * $i), 90, 17,$ES_NUMBER) GUICtrlSetState($aInput[$i-1],$GUI_ONTOP) GUICtrlSetLimit($aInput[$i-1], 3) Next EndFunc Edited April 11, 2017 by kamuline Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 20, 2017 Moderators Share Posted March 20, 2017 kamuline, My GUIListViewEx UDF (look in my sig for the link) allows you to have editable items within a ListView - you might want to take alook. M23 kamuline 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...
kamuline Posted March 29, 2017 Author Share Posted March 29, 2017 Ty, but its really a beast. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 29, 2017 Moderators Share Posted March 29, 2017 kamuline, if you are referring to the UDF, then I freely admit that it is a complex beast. But if you tell me what parts of your ListView need to be editable I will be happy to help you get it working as you require. M23 kamuline 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...
kamuline Posted April 11, 2017 Author Share Posted April 11, 2017 The second column, Quantity. Thanks for helping. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 11, 2017 Moderators Share Posted April 11, 2017 kamuline, This works for me: expandcollapse popup#include <GUIConstantsEx.au3> #include "GUIListViewEx.au3" $gui = GUICreate("Order", 210, 300) $List = GUICtrlCreateListView("", 1, 1, 204, 300) ; Always best to set the extended ListView styles like this ; And yo uneed the FULLROWSELECT extended style for the UDF to work _GUICtrlListView_SetExtendedListViewStyle($List, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES, $LVS_EX_CHECKBOXES)) GUISetState() _Fill() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch _GUIListViewEx_EventMonitor() ; This lets the UDF do its magic WEnd Func _Fill() Local $Materials[5] = ["mat 1", "mat 2", "mat 3", "mat 4", "mat 5"] _GUICtrlListView_AddColumn($List, "Materials", 100) _GUICtrlListView_AddColumn($List, "Quantity", 100) ; initialise the ListView $iList_Index = _GUIListViewEx_Init($List, "") ; Set column 1 to be an edit with an updown from 0 to 3 _GUIListViewEx_SetEditStatus($iList_Index, 1, 1, 1, "0|3|1") ; Insert the data - tellign the UDF that the array elementas are separate rows _GUIListViewEx_Insert($Materials, True) ; Register the NOTIFY messages - no need for the others _GUIListViewEx_MsgRegister(True, False, False, False) EndFunc ;==>_Fill Please ask if you have any questions. M23 kamuline 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...
kamuline Posted May 9, 2017 Author Share Posted May 9, 2017 Thank you. It's really useful. If i insist to my inputboxes, let me ask a dummy question. Is it possible to put the inputs to a list that scrolles down like a normal list? 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