FMS Posted September 26, 2019 Share Posted September 26, 2019 (edited) Hello, I'm trying to make a listview inside a GUI (as shown in the attached file) but couldn't figure it out how to get it. (the added file is just a eddited screenshot whit paint ) In the end I was hoping to : Iff user is checked then act acordanly on checked day (iff this make any sense ) Strangly enough i couldn't find anything on this forum because i thought i wasn't the only one who tried this kind of thing.(or is realy dated -earlyer then 2005 :S ) Is there somebody who could show me an example script or show me the direction to acomplish this? ;In case here's the code I used $GUI_userselection = GUICreate("Form1", 523, 265, -3084, -341) ;Global $aList[100] $GUI_userselection_list = GUICtrlCreateListView("Users|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday", 10, 10, 504, 215, $WS_BORDER, $LVS_EX_FULLROWSELECT + $LVS_EX_CHECKBOXES) For $i = 1 To UBound($MT_users,1) - 1 ;$handle = GUICtrlCreateListViewItem($MT_users[$i][0] & "|" & $MT_users[$i][3], $GUI_userselection_list) $handle = GUICtrlCreateListViewItem("User" & $i , $GUI_userselection_list) _GUICtrlListView_SetColumnWidth($GUI_userselection_list, 0, $LVSCW_AUTOSIZE_USEHEADER) ;$aList[$i] = $i Next $GUI_userselection_btn1 = GUICtrlCreateButton("Set", 360, 232, 75, 25) $GUI_userselection_btn2 = GUICtrlCreateButton("Cancel", 440, 232, 75, 25) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg(1) Switch $nMsg[1] Case $GUI_userselection Switch $nMsg[0] Case $GUI_EVENT_CLOSE GUIDelete($GUI_userselection) Case $GUI_userselection_btn1 For $x = 1 To _GUICtrlListView_GetItemCount ( $GUI_userselection_list ) $MT_users[$x][8] = 0 If _GUICtrlListView_GetItemChecked($GUI_userselection_list, $x - 1) Then MsgBox(0, "listview item", _GUICtrlListView_GetItemTextString($GUI_userselection_list, $x - 1) & " " & @CRLF & "Line Checked = " & $x, 2) $MT_users[$x][8] = 1 EndIf Next EndSwitch EndSwitch WEnd Edited September 26, 2019 by FMS as finishing touch god created the dutch Link to comment Share on other sites More sharing options...
BrewManNH Posted September 26, 2019 Share Posted September 26, 2019 Don't use a listview, listviews only support a checkbox in the first column as written in AutoIt. Ust use a series of check boxes in a GUI, should accomplish what you want. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
FMS Posted September 26, 2019 Author Share Posted September 26, 2019 Thanks for the reply @BrewManNH , that's realy unfortunate This beceause I've a array that's rather big and bulky that fills the listview (in the example code $MT_users) I was realy happy whit the scroll bars and the simplified While statement Now I realy don't now how to start a GUI whit variable checkboxes or scrollbars or how to read the "settings" when the button "set" is pushed. I was hoping if there is an examplescript out there on whish I can build on??? I'm not sure where to start searching for some example's because I don't now what I need as finishing touch god created the dutch Link to comment Share on other sites More sharing options...
seadoggie01 Posted September 26, 2019 Share Posted September 26, 2019 You could use an array of checkboxes and check if the the array contains one of your checkboxes. (This code doesn't work) Local $iGuiMsg While True $iGuiMsg = GUIGetMsg() Switch $iGuiMsg Case $GUI_EVENT_CLOSE Case Else Local $iCheckIndex = _ArraySearch($aCheckBoxes, $iGuiMsg) If Not @Error Then ; Do stuff with $aCheckBox[$iCheckIndex] EndIf EndSwitch EndWhile Func AddNewRow(ByRef $aCheckBoxes, $iRow) ; Base the location of the checkboxes off of the row you pass in and the width of your gui? _ArrayAdd($aCheckBoxes, GUICtrlCreateCheckBox() & "|" & _ GUICtrlCreateCheckBox() & "|" & _ GUICtrlCreateCheckBox() & "|" & _ GUICtrlCreateCheckBox() & "|" & _ GUICtrlCreateCheckBox() & "|" & _ GUICtrlCreateCheckBox() & "|" & _ GUICtrlCreateCheckBox()) EndFunc All my code provided is Public Domain... but it may not work. Use it, change it, break it, whatever you want. Spoiler My Humble Contributions:Personal Function Documentation - A personal HelpFile for your functionsAcro.au3 UDF - Automating Acrobat ProToDo Finder - Find #ToDo: lines in your scriptsUI-SimpleWrappers UDF - Use UI Automation more Simply-erKeePass UDF - Automate KeePass, a password managerInputBoxes - Simple Input boxes for various variable types Link to comment Share on other sites More sharing options...
dmob Posted September 27, 2019 Share Posted September 27, 2019 You're in luck 😀 I was looking for similar functionality and found this script on the forum. Sadly, I can't remember who wrote it... expandcollapse popup#region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=n #endregion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <array.au3> #include <GDIPlus.au3> #include <GuiConstantsEx.au3> #include <GuiListView.au3> #include <GuiImageList.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> #include <APIConstants.au3> #include <WinAPIEx.au3> _GDIPlus_Startup() $hGUI = GUICreate("Absent Capture", 675, 170) $cButton_CheckAll = GUICtrlCreateButton("Check All", 10, 145, 100, 20) $cButton_UncheckAll = GUICtrlCreateButton("UnCheck All", 120, 145, 100, 20) $cButton_StatesToArray = GUICtrlCreateButton("States to Array", 222, 145, 100, 20) $cListView = GUICtrlCreateListView("", 2, 2, 667, 120, BitOR($LVS_REPORT, $LVS_SHOWSELALWAYS)) $hListView = GUICtrlGetHandle($cListView) _GUICtrlListView_SetExtendedListViewStyle($hListView, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES)) $hIml_Listview = _GUIImageList_Create(16, 16, 5, 3) $hBitmap_Icon = _Load_BMP_From_Mem(_Icon_Image_Checkbox_Unchecked(), True) _GUIImageList_Add($hIml_Listview, $hBitmap_Icon) _WinAPI_DeleteObject($hBitmap_Icon) $hBitmap_Icon = _Load_BMP_From_Mem(_Icon_Image_Checkbox_Checked(), True) _GUIImageList_Add($hIml_Listview, $hBitmap_Icon) _WinAPI_DeleteObject($hBitmap_Icon) _GUICtrlListView_SetImageList($hListView, $hIml_Listview, 1) ; Add columns _GUICtrlListView_AddColumn($hListView, " Name", 175, 0) For $c = 1 To 21 _GUICtrlListView_AddColumn($hListView, $c, 22 + ($c>9 ? 2 : 0), 0) Next ; Add items _GUICtrlListView_AddItem($hListView, "Mathinjwa, Oluhle S", 0) _GUICtrlListView_SetItemImage($hListView, 0, 10, 0) For $c = 1 To 21 _GUICtrlListView_AddSubItem($hListView, 0, " ", $c, 0) Next _GUICtrlListView_AddItem($hListView, "Maphumulo, Siphiwokuhle", 0) _GUICtrlListView_SetItemImage($hListView, 1, 10, 0) For $c = 1 To 21 _GUICtrlListView_AddSubItem($hListView, 1, " ", $c, 0) Next _GUICtrlListView_AddItem($hListView, "MNGOMEZULU, Mqobi Kazimoto", 0) _GUICtrlListView_SetItemImage($hListView, 2, 10, 0) For $c = 1 To 21 _GUICtrlListView_AddSubItem($hListView, 2, " ", $c, 0) Next GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") GUISetState() ; Loop until user exits While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $cButton_CheckAll _LV_ImgCheckboxes_CheckAll($hListView) Case $cButton_UncheckAll _LV_ImgCheckboxes_UncheckAll($hListView) Case $cButton_StatesToArray $aLVStates = _LV_ImgCheckboxes_StatesToArray($hListView) _ArrayDisplay($aLVStates) EndSwitch WEnd GUIDelete() _GUIImageList_Destroy($hIml_Listview) _GDIPlus_Shutdown() Exit Func _LV_ImgCheckboxes_CheckAll($hWnd) _GUICtrlListView_BeginUpdate($hWnd) For $i = 0 To _GUICtrlListView_GetItemCount($hWnd) - 1 For $y = 0 To _GUICtrlListView_GetColumnCount($hWnd) - 1 _GUICtrlListView_SetItemImage($hWnd, $i, 1, $y) Next Next _GUICtrlListView_EndUpdate($hWnd) EndFunc ;==>_LV_ImgCheckboxes_CheckAll Func _LV_ImgCheckboxes_UncheckAll($hWnd) _GUICtrlListView_BeginUpdate($hWnd) For $i = 0 To _GUICtrlListView_GetItemCount($hWnd) - 1 For $y = 0 To _GUICtrlListView_GetColumnCount($hWnd) - 1 _GUICtrlListView_SetItemImage($hWnd, $i, 0, $y) Next Next _GUICtrlListView_EndUpdate($hWnd) EndFunc ;==>_LV_ImgCheckboxes_UncheckAll Func _LV_ImgCheckboxes_StatesToArray($hWnd) Local $iColumns = _GUICtrlListView_GetColumnCount($hWnd) If $iColumns = 0 Then Return SetError(1) Local $iItems = _GUICtrlListView_GetItemCount($hWnd) If $iItems = 0 Then Return SetError(2) Local $aStates[$iItems][$iColumns] For $i = 0 To $iItems - 1 For $y = 0 To $iColumns - 1 $aStates[$i][$y] = _GUICtrlListView_GetItemImage($hWnd, $i, $y) Next Next Return $aStates EndFunc ;==>_LV_ImgCheckboxes_StatesToArray Func WM_NOTIFY($hWnd, $Msg, $wParam, $lParam) Local $tNMHDR = DllStructCreate($tagNMHDR, $lParam) Local $hWndFrom = DllStructGetData($tNMHDR, "hWndFrom") Local $nNotifyCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hListView Switch $nNotifyCode Case $NM_CUSTOMDRAW ; http://www.autoitscript.com/forum/topic/123757-focushighlight-a-certain-item-in-a-listview/page__view__findpost__p__859598 ; Mat & Siao If Not _GUICtrlListView_GetViewDetails($hWndFrom) Then Return $GUI_RUNDEFMSG ; Not in details mode Local $tCustDraw, $iDrawStage, $iItem, $iSubitem, $hDC, $tRect, $iColor1, $iColor2, $iColor3 $tCustDraw = DllStructCreate($tagNMLVCUSTOMDRAW, $lParam) $iDrawStage = DllStructGetData($tCustDraw, 'dwDrawStage') Switch $iDrawStage Case $CDDS_PREPAINT Return $CDRF_NOTIFYITEMDRAW Case $CDDS_ITEMPREPAINT Return $CDRF_NOTIFYSUBITEMDRAW Case $CDDS_ITEMPOSTPAINT ; Not handled Case BitOR($CDDS_ITEMPREPAINT, $CDDS_SUBITEM) Local $iItem = DllStructGetData($tCustDraw, 'dwItemSpec') Local $iSubitem = DllStructGetData($tCustDraw, 'iSubItem') If $iSubitem > 0 And _GUICtrlListView_GetItemSelected($hWndFrom, $iItem) Then ; Item to draw is selected Local $hDC = _WinAPI_GetDC($hWndFrom) Local $tRect = DllStructCreate($tagRECT) Local $pRect = DllStructGetPtr($tRect) ; We draw the background when we draw the first item. If $iSubitem = 0 Then ; We must send the message as we want to use the struct. _GUICtrlListView_GetSubItemRect returns an array. _SendMessage($hWndFrom, $LVM_GETSUBITEMRECT, $iItem, $pRect) DllStructSetData($tRect, "Left", 0) _WinAPI_FillRect($hDC, DllStructGetPtr($tRect), _WinAPI_GetStockObject(0)) ; NULL_PEN to overwrite default highlighting EndIf DllStructSetData($tRect, "Left", 2) DllStructSetData($tRect, "Top", $iSubitem) _SendMessage($hWndFrom, $LVM_GETSUBITEMRECT, $iItem, DllStructGetPtr($tRect)) Local $sText = _GUICtrlListView_GetItemText($hWndFrom, $iItem, $iSubitem) _WinAPI_SetBkMode($hDC, $TRANSPARENT) ; It uses the background drawn for the first item. ; Select the font we want to use _WinAPI_SelectObject($hDC, _SendMessage($hWndFrom, $WM_GETFONT)) Local $hIcon = _GUIImageList_GetIcon($hIml_Listview, _GUICtrlListView_GetItemImage($hListView, $iItem, $iSubitem)) ;~ If $iSubitem = 0 Then ;~ _WinAPI_DrawIconEx($hDC, DllStructGetData($tRect, "Left") - 16, DllStructGetData($tRect, "Top") + 1, $hIcon, 16, 16) ;~ DllStructSetData($tRect, "Left", DllStructGetData($tRect, "Left") + 2) ;~ Else ;~ _WinAPI_DrawIconEx($hDC, DllStructGetData($tRect, "Left"), DllStructGetData($tRect, "Top") + 1, $hIcon, 16, 16) ;~ DllStructSetData($tRect, "Left", DllStructGetData($tRect, "Left") + 6 + 18) ;~ EndIf If $iSubitem = 0 Then _GUICtrlListView_SetItemImage($hListView, $iItem, 10, 0) Else _WinAPI_DrawIconEx($hDC, DllStructGetData($tRect, "Left"), DllStructGetData($tRect, "Top") + 1, $hIcon, 16, 16) DllStructSetData($tRect, "Left", DllStructGetData($tRect, "Left") + 6 + 18) EndIf _GUIImageList_DestroyIcon($hIcon) _WinAPI_DrawText($hDC, $sText, $tRect, BitOR($DT_VCENTER, $DT_END_ELLIPSIS, $DT_SINGLELINE)) _WinAPI_ReleaseDC($hWndFrom, $hDC) Return $CDRF_SKIPDEFAULT ; Don't do default processing EndIf _GUICtrlListView_SetItemImage($hListView, $iItem, 10, 0) Return $CDRF_NEWFONT ; Let the system do the drawing for non-selected items Case BitOR($CDDS_ITEMPOSTPAINT, $CDDS_SUBITEM) ; Not handled EndSwitch Case $NM_CLICK Local $tINFO = DllStructCreate($tagNMITEMACTIVATE, $lParam) Local $iItem = DllStructGetData($tINFO, "Index") Local $iSubitem = DllStructGetData($tINFO, "SubItem") _GUICtrlListView_SetItemImage($hListView, $iItem, Not _GUICtrlListView_GetItemImage($hListView, $iItem, $iSubitem), $iSubitem) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY ; Based on File to Base64 String Code Generator ; by UEZ ; http://www.autoitscript.com/forum/topic/134350-file-to-base64-string-code-generator-v103-build-2011-11-21/ ;====================================================================================== ; Function Name: Load_BMP_From_Mem ; Description: Loads an image which is saved as a binary string and converts it to a bitmap or hbitmap ; ; Parameters: $bImage: the binary string which contains any valid image which is supported by GDI+ ; Optional: $hHBITMAP: if false a bitmap will be created, if true a hbitmap will be created ; ; Remark: hbitmap format is used generally for GUI internal images, $bitmap is more a GDI+ image format ; Don't forget _GDIPlus_Startup() and _GDIPlus_Shutdown() ; ; Requirement(s): GDIPlus.au3, Memory.au3 and _GDIPlus_BitmapCreateDIBFromBitmap() from WinAPIEx.au3 ; Return Value(s): Success: handle to bitmap (GDI+ bitmap format) or hbitmap (WinAPI bitmap format), ; Error: 0 ; Error codes: 1: $bImage is not a binary string ; 2: unable to create stream on HGlobal ; 3: unable to create bitmap from stream ; ; Author(s): UEZ ; Additional Code: thanks to progandy for the MemGlobalAlloc and tVARIANT lines and ; Yashied for _GDIPlus_BitmapCreateDIBFromBitmap() from WinAPIEx.au3 ; Version: v0.97 Build 2012-01-04 Beta ;======================================================================================= Func _Load_BMP_From_Mem($bImage, $hHBITMAP = False) If Not IsBinary($bImage) Then Return SetError(1, 0, 0) Local $aResult Local Const $memBitmap = Binary($bImage) ;load image saved in variable (memory) and convert it to binary Local Const $len = BinaryLen($memBitmap) ;get length of image Local Const $hData = _MemGlobalAlloc($len, $GMEM_MOVEABLE) ;allocates movable memory ($GMEM_MOVEABLE = 0x0002) Local Const $pData = _MemGlobalLock($hData) ;translate the handle into a pointer Local $tMem = DllStructCreate("byte[" & $len & "]", $pData) ;create struct DllStructSetData($tMem, 1, $memBitmap) ;fill struct with image data _MemGlobalUnlock($hData) ;decrements the lock count associated with a memory object that was allocated with GMEM_MOVEABLE $aResult = DllCall("ole32.dll", "int", "CreateStreamOnHGlobal", "handle", $pData, "int", True, "ptr*", 0) ;Creates a stream object that uses an HGLOBAL memory handle to store the stream contents If @error Then SetError(2, 0, 0) Local Const $hStream = $aResult[3] $aResult = DllCall($__g_hGDIPDll, "uint", "GdipCreateBitmapFromStream", "ptr", $hStream, "int*", 0) ;Creates a Bitmap object based on an IStream COM interface If @error Then SetError(3, 0, 0) Local Const $hBitmap = $aResult[2] Local $tVARIANT = DllStructCreate("word vt;word r1;word r2;word r3;ptr data; ptr") DllCall("oleaut32.dll", "long", "DispCallFunc", "ptr", $hStream, "dword", 8 + 8 * @AutoItX64, _ "dword", 4, "dword", 23, "dword", 0, "ptr", 0, "ptr", 0, "ptr", DllStructGetPtr($tVARIANT)) ;release memory from $hStream to avoid memory leak $tMem = 0 $tVARIANT = 0 If $hHBITMAP Then Local Const $hHBmp = _GDIPlus_BitmapCreateDIBFromBitmap($hBitmap) _GDIPlus_BitmapDispose($hBitmap) Return $hHBmp EndIf Return $hBitmap EndFunc ;==>_Load_BMP_From_Mem ;~ Func _GDIPlus_BitmapCreateDIBFromBitmap($hBitmap) ;~ Local $tBIHDR, $Ret, $tData, $pBits, $hResult = 0 ;~ $Ret = DllCall($__g_hGDIPDll, 'uint', 'GdipGetImageDimension', 'ptr', $hBitmap, 'float*', 0, 'float*', 0) ;~ If (@error) Or ($Ret[0]) Then Return 0 ;~ $tData = _GDIPlus_BitmapLockBits($hBitmap, 0, 0, $Ret[2], $Ret[3], $GDIP_ILMREAD, $GDIP_PXF32ARGB) ;~ $pBits = DllStructGetData($tData, 'Scan0') ;~ If Not $pBits Then Return 0 ;~ $tBIHDR = DllStructCreate('dword;long;long;ushort;ushort;dword;dword;long;long;dword;dword') ;~ DllStructSetData($tBIHDR, 1, DllStructGetSize($tBIHDR)) ;~ DllStructSetData($tBIHDR, 2, $Ret[2]) ;~ DllStructSetData($tBIHDR, 3, $Ret[3]) ;~ DllStructSetData($tBIHDR, 4, 1) ;~ DllStructSetData($tBIHDR, 5, 32) ;~ DllStructSetData($tBIHDR, 6, 0) ;~ $hResult = DllCall('gdi32.dll', 'ptr', 'CreateDIBSection', 'hwnd', 0, 'ptr', DllStructGetPtr($tBIHDR), 'uint', 0, 'ptr*', 0, 'ptr', 0, 'dword', 0) ;~ If (Not @error) And ($hResult[0]) Then ;~ DllCall('gdi32.dll', 'dword', 'SetBitmapBits', 'ptr', $hResult[0], 'dword', $Ret[2] * $Ret[3] * 4, 'ptr', DllStructGetData($tData, 'Scan0')) ;~ $hResult = $hResult[0] ;~ Else ;~ $hResult = 0 ;~ EndIf ;~ _GDIPlus_BitmapUnlockBits($hBitmap, $tData) ;~ Return $hResult ;~ EndFunc ;==>_GDIPlus_BitmapCreateDIBFromBitmap Func _Decompress_Binary_String_to_Bitmap($Base64String) $Base64String = Binary($Base64String) Local $iSize_Source = BinaryLen($Base64String) Local $pBuffer_Source = _WinAPI_CreateBuffer($iSize_Source) DllStructSetData(DllStructCreate('byte[' & $iSize_Source & ']', $pBuffer_Source), 1, $Base64String) Local $pBuffer_Decompress = _WinAPI_CreateBuffer(8388608) Local $Size_Decompressed = _WinAPI_DecompressBuffer($pBuffer_Decompress, 8388608, $pBuffer_Source, $iSize_Source) Local $b_Result = Binary(DllStructGetData(DllStructCreate('byte[' & $Size_Decompressed & ']', $pBuffer_Decompress), 1)) _WinAPI_FreeMemory($pBuffer_Source) _WinAPI_FreeMemory($pBuffer_Decompress) Return $b_Result EndFunc ;==>_Decompress_Binary_String_to_Bitmap Func _Icon_Image_Checkbox_Unchecked() Local $Base64String $Base64String &= '7rBIAAABABAQEAFwCAAAaAUAABYAAMwAKAAYAJAAIAAYAVwZAQBAAQIYDgCAgAAAANfc3ADZ3t4AANvg4ADe4uIAAOLl5QDl6OgAAOns7ADs7+8AAO/x8QDx8/MAAPT19QD29/cAAPj5+QD6+/sAAPz9/QD+/v7wAP///xNc/wB/AD8A/z8APwA/AD8APwA/AD8ACAAb4HYLAAEJAOEBCgsMAA0ODxAREhISbeIBCQcC4gEIBwLiAQfbBwLiAQYHAuIBBQcC4gG2BAcC4gEDBwLiAQIHAv/jAQcC5AEGAuIB7BceAOCfHgN/AG0A4QZhAA==' Return _Decompress_Binary_String_to_Bitmap(_Base64Decode($Base64String)) EndFunc ;==>_Icon_Image_Checkbox_Unchecked Func _Icon_Image_Checkbox_Checked() Local $Base64String ;$Base64String &= 'z7BIAAABABAQEAFwCAAAaAUAABYAAMwAKAAYAJAAIAAYAVwZAQBAAQIYDgCAgAAAAISEhADe3t5AAN7n5wDnAQbvCO8A7wEG9/cA9/EABv///xN4/wE/AD8A/z8APwA/AD8AHwAMAOB6CwAGAQkA4QEHCAkJCR4KAgDjAQcC5AEHCAKDAwLiAQYHBwICAwI54gEFBsABAwLjAQUCxgIkBOIBBAUCRQbjAVgEBQUCAuQBAwUCCPPkAQUCBwjkAQYC4gHsF3seAOCfA38AbQDhBmEA' $Base64String &= 'YbJIAAABABAQEAFwIAAAaAQAABYAAHwAKAAYAJAAiAO4FQD/hP//SgYAAPHsAAOrAAgFA+8EA+0BA+0bOwD17Bog9f88TAD5/zpJ+P84RwD4/zVF+P80QwD3/zJC9/8UGwkBT+3oEzv37B0jAPn/RFP6/yQpAPn/EhL3/w8PAPb/DAz1/wkJgPX/Fhv1/zOAIwGRIQAA+ewfJfoA/0pY+/9CR/sA/8nJ/f87O/kA/xMT9/8QEPYA/zMz9//Fxf2A/zA19/80RIEhAvKKIQAA+/9PXQD9/zI3+//LywD+//Ly///r6wL+giE5Ofj/6uog/v/x8f6CIRgdD4AngEOBiYcf/f9SXwD9/ygo/P9HR2D8/+zs/4IhgQPsCuyBHf+CITQ09/8YCwv1gomNH1Vi/gD/LCz9/ykp/OD/SEj8/0FawRDDEZD+/zo6x0Q4SMEPAwAVyA9XZP7/MDAA/f8tLf3/S0sBzQ///z09+f8WJBb4wkQ8S80P//8IWmf+wEn+/1BQ4v3CDvPz/8IBxRHBIAA+Pvr/Fxf4/wg/TvnOD1to//9AQ0f+/8/Pxw5MIEz8/0pKx0PKygD+/yov+v9CUQ76AA0ACccP6yYr/wD/XWr//1hb/wHCEFJS/v8vL/0DwkTBM8zM/v9ITMD7/0lX+//BicCaRuvLgMcQQ0f/wFr+iP8yMsdEODz8wHg8/P/BicCayg7NEFxpA8MzwURYZf7/VmMA/v9UYf7/Iifa/AAJ+0Ay2cD/wM8BAj3FAP3JAEBC/+hrAAAAAPAPAADgBwAAwMADAACAAXsAYQQHYQVhBmEH' Return _Decompress_Binary_String_to_Bitmap(_Base64Decode($Base64String)) EndFunc ;==>_Icon_Image_Checkbox_Checked Func _Base64Decode($input_string) Local $struct = DllStructCreate("int") Local $a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", "str", $input_string, "int", 0, "int", 1, "ptr", 0, "ptr", DllStructGetPtr($struct, 1), "ptr", 0, "ptr", 0) If @error Or Not $a_Call[0] Then Return SetError(1, 0, "") Local $a = DllStructCreate("byte[" & DllStructGetData($struct, 1) & "]") $a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", "str", $input_string, "int", 0, "int", 1, "ptr", DllStructGetPtr($a), "ptr", DllStructGetPtr($struct, 1), "ptr", 0, "ptr", 0) If @error Or Not $a_Call[0] Then Return SetError(2, 0, "") Return DllStructGetData($a, 1) EndFunc ;==>_Base64Decode You will need some modification. I modified it to show some other icon in first column. Zedna and Musashi 2 Link to comment Share on other sites More sharing options...
FMS Posted October 10, 2019 Author Share Posted October 10, 2019 thanks @BrewManNH @seadoggie01 & @dmob, I'm fiddeling around whit your tips but couldn't got it to work. At this point I got this (and i know I need to put the checkboxes in the right row but first I want it to work properly :)) The example that @dmob sugested was a little too big for me to understand but seems legit Is there somebody who can help me whit this buggy script because I realy don't know how Func GUI_userselection() $GUI_userselection = GUICreate("Form1", 523, 265, -3084, -341) $GUI_userselection_list = GUICtrlCreateList("Users|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday", 10, 10, 504, 215) For $i = 1 To UBound($MT_users,1) - 1 Global $LC_tmp_chkbx[1][8] $LC_tmp_chkbx[0][0] = $MT_users[$i][0] $LC_tmp_chkbx[0][1] = GUICtrlCreateCheckBox("Monday",10,10,520,220) $LC_tmp_chkbx[0][2] = GUICtrlCreateCheckBox("Tuesday",10,30,540,220) Next GUICtrlSetData($GUI_userselection_list, $LC_tmp_chkbx) ; _ArrayDisplay($LC_tmp_chkbx) $GUI_userselection_btn1 = GUICtrlCreateButton("Set", 360, 232, 75, 25) $GUI_userselection_btn2 = GUICtrlCreateButton("Cancel", 440, 232, 75, 25) GUISetState(@SW_SHOW) EndFunc as finishing touch god created the dutch Link to comment Share on other sites More sharing options...
seadoggie01 Posted October 10, 2019 Share Posted October 10, 2019 TBH, I have no idea what dmob is doing, but it looks beautiful. I wish I knew half of what that script was doing. Maybe this one will make a bit more sense, but it doesn't look nearly as nice. It's based on a two-dimensional array of CheckBox handles, use _ArrayDisplay if you need/want to see it I hope this is helpful. I can't integrate mine with a list, but you could create labels and pretend expandcollapse popup#include <GUIConstants.au3> #include <Array.au3> #include <Date.au3> Main() Func Main() GUICreate("Check Box Array!", 280, 150) Local $aCheckBoxes[0][7] ; Array of CheckBoxes AddNewRow($aCheckBoxes, 1, 20, 20) ; Add a row AddNewRow($aCheckBoxes, 2, 20, 20) ; Add a row AddNewRow($aCheckBoxes, 3, 20, 20) ; Add a row AddNewRow($aCheckBoxes, 4, 20, 20) ; Add a row AddNewRow($aCheckBoxes, 5, 20, 20) ; Add a row GUISetState() Local $iGuiMsg While True $iGuiMsg = GUIGetMsg() Switch $iGuiMsg Case $GUI_EVENT_CLOSE ExitLoop Case Else ; Put any other cases above this ; Try to find a checkbox handle that matches the message Local $vCheckIndex = FindCheckBox($aCheckBoxes, $iGuiMsg) ; If there was a match If $vCheckIndex <> False Then Local $iRowFound = $vCheckIndex[0] Local $iColFound = $vCheckIndex[1] ; If the CheckBox was checked Then If ($GUI_CHECKED==GUICtrlRead($aCheckBoxes[$iRowFound][$iColFound])) Then MsgBox(0, "I was clicked!", "You checked me! User: " & $iRowFound + 1 & " on " & _DateDayOfWeek($iColFound+1)) EndIf EndIf EndSwitch WEnd EndFunc ; Accepts an array to add the handles from CheckBoxes to, the next row to create, and an optional Horizontal and vertical offset to move them around Func AddNewRow(ByRef $aCheckBoxes, $iRow, $h_Offset=0, $v_Offset=0) Local Const $V_PADDING = 5 ; Adds vertical space between rows of CheckBoxes Local Const $H_PADDING = 5 ; Adds horizontal space between CheckBoxes Local Const $CONT_HEIGHT = 15 ; The height of the CheckBoxes Local Const $CONT_WIDTH = 28 ; The width of the CheckBoxes ; Base the location of the CheckBoxes off of the row you pass in _ArrayAdd($aCheckBoxes, _ GUICtrlCreateCheckBox("S", $H_PADDING*1 + $CONT_WIDTH*0 + $h_Offset, $V_PADDING*$iRow + $CONT_HEIGHT*($iRow-1) + $v_Offset,$CONT_WIDTH, $CONT_HEIGHT) & "|" & _ GUICtrlCreateCheckBox("M", $H_PADDING*2 + $CONT_WIDTH*1 + $h_Offset, $V_PADDING*$iRow + $CONT_HEIGHT*($iRow-1) + $v_Offset,$CONT_WIDTH, $CONT_HEIGHT) & "|" & _ GUICtrlCreateCheckBox("T", $H_PADDING*3 + $CONT_WIDTH*2 + $h_Offset, $V_PADDING*$iRow + $CONT_HEIGHT*($iRow-1) + $v_Offset,$CONT_WIDTH, $CONT_HEIGHT) & "|" & _ GUICtrlCreateCheckBox("W", $H_PADDING*4 + $CONT_WIDTH*3 + $h_Offset, $V_PADDING*$iRow + $CONT_HEIGHT*($iRow-1) + $v_Offset,$CONT_WIDTH, $CONT_HEIGHT) & "|" & _ GUICtrlCreateCheckBox("T", $H_PADDING*5 + $CONT_WIDTH*4 + $h_Offset, $V_PADDING*$iRow + $CONT_HEIGHT*($iRow-1) + $v_Offset,$CONT_WIDTH, $CONT_HEIGHT) & "|" & _ GUICtrlCreateCheckBox("F", $H_PADDING*6 + $CONT_WIDTH*5 + $h_Offset, $V_PADDING*$iRow + $CONT_HEIGHT*($iRow-1) + $v_Offset,$CONT_WIDTH, $CONT_HEIGHT) & "|" & _ GUICtrlCreateCheckBox("S", $H_PADDING*7 + $CONT_WIDTH*6 + $h_Offset, $V_PADDING*$iRow + $CONT_HEIGHT*($iRow-1) + $v_Offset,$CONT_WIDTH, $CONT_HEIGHT)) EndFunc ; Check if the passed handle is in the array, and return location or False Func FindCheckBox($aCheckBoxes, $hCheck) Local $aLoc[2] ; For each row (first dim) For $first=0 To UBound($aCheckBoxes, 1) - 1 ; For each column (second dim) For $second=0 To UBound($aCheckBoxes, 2) - 1 ; If there's a match If $aCheckBoxes[$first][$second] = $hCheck Then ; Return an array marking the [row,column] $aLoc[0] = $first $aLoc[1] = $second Return $aLoc EndIf Next Next Return False EndFunc All my code provided is Public Domain... but it may not work. Use it, change it, break it, whatever you want. Spoiler My Humble Contributions:Personal Function Documentation - A personal HelpFile for your functionsAcro.au3 UDF - Automating Acrobat ProToDo Finder - Find #ToDo: lines in your scriptsUI-SimpleWrappers UDF - Use UI Automation more Simply-erKeePass UDF - Automate KeePass, a password managerInputBoxes - Simple Input boxes for various variable types Link to comment Share on other sites More sharing options...
FMS Posted October 10, 2019 Author Share Posted October 10, 2019 whoo thanks @seadoggie01 for this nice example, also whit good comment's in it. I'll fiddle around whit it in the next couple of hours to try (because there a lot of row's being inserted) adding a scroll bar (the reason I was using listview in the beginnin ) seadoggie01 1 as finishing touch god created the dutch Link to comment Share on other sites More sharing options...
LarsJ Posted October 10, 2019 Share Posted October 10, 2019 Implementing subitem checkboxes in a listview is super simple: expandcollapse popup#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 Opt( "MustDeclareVars", 1 ) #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> Global $idListView, $hListView Example() Func Example() ; Create GUI GUICreate( "Listview with subitem checkboxes", 800, 598+20 ) ; Create ListView $idListView = GUICtrlCreateListView( "", 10, 10, 800-20, 598, $GUI_SS_DEFAULT_LISTVIEW, $WS_EX_CLIENTEDGE ) _GUICtrlListView_SetExtendedListViewStyle( $idListView, $LVS_EX_DOUBLEBUFFER+$LVS_EX_SUBITEMIMAGES ) ; Subitem images $hListView = GUICtrlGetHandle( $idListView ) ; ImageList Local $idListView2 = GUICtrlCreateListView( "", 0, 0, 1, 1 ) ; 1x1 pixel listview to create state image list with checkbox icons _GUICtrlListView_SetExtendedListViewStyle( $idListView2, $LVS_EX_CHECKBOXES ) ; The $LVS_EX_CHECKBOXES style forces the state image list to be created Local $hImageList = _GUICtrlListView_GetImageList( $idListView2, 2 ) ; Get the state image list with unchecked and checked checkbox icons _GUICtrlListView_SetImageList( $idListView, $hImageList, 1 ) ; Set the state image list as a normal small icon image list in $idListView ; Now the checkboxes can be handled like normal subitem icons ; Add 10 columns For $i = 0 To 9 _GUICtrlListView_AddColumn( $idListView, "Col " & $i, 75 ) Next ; Add 100 rows For $i = 0 To 100 - 1 _GUICtrlListView_AddItem( $idListView, $i, 0 ) ; Image index 0 = unchecked checkbox For $j = 1 To 9 _GUICtrlListView_AddSubItem( $idListView, $i, $i & " / " & $j, $j, 0 ) ; Image index 0 = unchecked checkbox Next Next ; WM_NOTIFY message handler to toggle checkboxes GUIRegisterMsg( $WM_NOTIFY, "WM_NOTIFY" ) ; Show GUI GUISetState( @SW_SHOW ) ; Message loop While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ; Cleanup GUIDelete() EndFunc ; Message handler to toggle checkboxes Func WM_NOTIFY( $hWnd, $iMsg, $wParam, $lParam ) Local $tNMHDR = DllStructCreate( $tagNMHDR, $lParam ) Switch HWnd( DllStructGetData( $tNMHDR, "hWndFrom" ) ) Case $hListView Switch DllStructGetData( $tNMHDR, "Code" ) Case $NM_CLICK Local $aHit = _GUICtrlListView_SubItemHitTest( $hListView ) If $aHit[0] >= 0 And $aHit[1] >= 0 Then ; Item and subitem Local $iIcon = _GUICtrlListView_GetItemImage( $idListView, $aHit[0], $aHit[1] ) ; Get checkbox icon _GUICtrlListView_SetItemImage( $idListView, $aHit[0], $iIcon = 0 ? 1 : 0, $aHit[1] ) ; Toggle checkbox icon _GUICtrlListView_RedrawItems( $idListView, $aHit[0], $aHit[0] ) ; Redraw listview item EndIf EndSwitch EndSwitch Return $GUI_RUNDEFMSG #forceref $hWnd, $iMsg, $wParam EndFunc The idea is addressed in this example. FMS, Zedna and pixelsearch 3 Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
FMS Posted October 15, 2019 Author Share Posted October 15, 2019 very very nice @LarsJ, totaly what i was looking for. 1 question about this i hope u could help me whit. I added a button whish should read the "settings" or loop acros the checkboxes to check if one is checked or not. What i want to do -> if first checkbox of row is checked check the other checkboxes in that row. Is there anyway you or anyone else could help me in reading the checkboxes? I tried to put them into an array but don't get the expected result or did i missed something in the code? Thanks in advanced. expandcollapse popup#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 Opt( "MustDeclareVars", 1 ) #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> Global $idListView, $hListView Example() Func Example() ; Create GUI GUICreate( "Listview with subitem checkboxes", 800, 598+20+50 ) ;GUICreate ( "title" [, width [, height [, left = -1 [, top = -1 [, style = -1 [, exStyle = -1 [, parent = 0]]]]]]] ) Global $GS1_btn1 = GUICtrlCreateButton("Button1", 620, 620, 75, 25) Global $GS1_btn2 = GUICtrlCreateButton("Button2", 720, 620, 75, 25) ;GUICtrlCreateButton ( "text", left, top [, width [, height [, style = -1 [, exStyle = -1]]]] ) ; Create ListView $idListView = GUICtrlCreateListView( "", 10, 10, 800-20, 598, $GUI_SS_DEFAULT_LISTVIEW, $WS_EX_CLIENTEDGE ) _GUICtrlListView_SetExtendedListViewStyle( $idListView, $LVS_EX_DOUBLEBUFFER+$LVS_EX_SUBITEMIMAGES ) ; Subitem images $hListView = GUICtrlGetHandle( $idListView ) ; ImageList Local $idListView2 = GUICtrlCreateListView( "", 0, 0, 1, 1 ) ; 1x1 pixel listview to create state image list with checkbox icons _GUICtrlListView_SetExtendedListViewStyle( $idListView2, $LVS_EX_CHECKBOXES ) ; The $LVS_EX_CHECKBOXES style forces the state image list to be created Local $hImageList = _GUICtrlListView_GetImageList( $idListView2, 2 ) ; Get the state image list with unchecked and checked checkbox icons _GUICtrlListView_SetImageList( $idListView, $hImageList, 1 ) ; Set the state image list as a normal small icon image list in $idListView ; Now the checkboxes can be handled like normal subitem icons ; Add 10 columns Local $text = "" For $i = 0 To 7 if $i = 0 Then $text = "Users" if $i = 1 Then $text = "Monday" if $i = 2 Then $text = "Tuesday" if $i = 3 Then $text = "Wednesday" if $i = 4 Then $text = "Thursday" if $i = 5 Then $text = "Friday" if $i = 6 Then $text = "Saturday" if $i = 7 Then $text = "Sunday" _GUICtrlListView_AddColumn( $idListView, $text, 75 ) Next ; Add 100 rows Local $checkboxes[101][8] For $i = 0 To 100 - 1 $checkboxes[$i][0] = _GUICtrlListView_AddItem( $idListView, "User "& $i, 0 ) ; Image index 0 = unchecked checkbox For $j = 1 To 7 ConsoleWrite("i = " & $i & " j =" & $j & @LF) $checkboxes[$i][$j] = _GUICtrlListView_AddSubItem( $idListView, $i, $i & " / " & $j, $j, 0 ) ; Image index 0 = unchecked checkbox Next Next ; WM_NOTIFY message handler to toggle checkboxes GUIRegisterMsg( $WM_NOTIFY, "WM_NOTIFY" ) ; Show GUI GUISetState( @SW_SHOW ) ; Message loop While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop case $GS1_btn1 _ArrayDisplay($checkboxes) case $GS1_btn2 MsgBox($MB_SYSTEMMODAL, "Title", "button 2 is pressed.", 10) EndSwitch WEnd ; Cleanup GUIDelete() EndFunc ; Message handler to toggle checkboxes Func WM_NOTIFY( $hWnd, $iMsg, $wParam, $lParam ) Local $tNMHDR = DllStructCreate( $tagNMHDR, $lParam ) Switch HWnd( DllStructGetData( $tNMHDR, "hWndFrom" ) ) Case $hListView Switch DllStructGetData( $tNMHDR, "Code" ) Case $NM_CLICK Local $aHit = _GUICtrlListView_SubItemHitTest( $hListView ) If $aHit[0] >= 0 And $aHit[1] >= 0 Then ; Item and subitem Local $iIcon = _GUICtrlListView_GetItemImage( $idListView, $aHit[0], $aHit[1] ) ; Get checkbox icon _GUICtrlListView_SetItemImage( $idListView, $aHit[0], $iIcon = 0 ? 1 : 0, $aHit[1] ) ; Toggle checkbox icon _GUICtrlListView_RedrawItems( $idListView, $aHit[0], $aHit[0] ) ; Redraw listview item EndIf EndSwitch EndSwitch Return $GUI_RUNDEFMSG #forceref $hWnd, $iMsg, $wParam EndFunc as finishing touch god created the dutch Link to comment Share on other sites More sharing options...
seadoggie01 Posted October 15, 2019 Share Posted October 15, 2019 (edited) _GUICtrlListView_AddSubItem returns T/F if the item was created. You're storing the result in your checkbox array, which will always show an Array of True... You'll want to check if an item is checked by looking at the Item's Image index... use _GUICtrlListView_GetItemImage to find it. I did it quickly like this: For $row = 0 To UBound($checkboxes, 1) - 1 For $column = 0 to UBound($checkboxes, 2) - 1 $checkboxes[$row][$column] = _GUICtrlListView_GetItemImage($idListView, $row, $column) Next Next _ArrayDisplay($checkboxes) Edit: Also, your $checkboxes array is 1 too big Edited October 15, 2019 by seadoggie01 FMS 1 All my code provided is Public Domain... but it may not work. Use it, change it, break it, whatever you want. Spoiler My Humble Contributions:Personal Function Documentation - A personal HelpFile for your functionsAcro.au3 UDF - Automating Acrobat ProToDo Finder - Find #ToDo: lines in your scriptsUI-SimpleWrappers UDF - Use UI Automation more Simply-erKeePass UDF - Automate KeePass, a password managerInputBoxes - Simple Input boxes for various variable types Link to comment Share on other sites More sharing options...
FMS Posted October 15, 2019 Author Share Posted October 15, 2019 many thanks to all for the good examples and axplanations , this is totaly solved . as finishing touch god created the dutch Link to comment Share on other sites More sharing options...
FMS Posted October 17, 2019 Author Share Posted October 17, 2019 @seadoggie01 & @LarsJ, althoug the problem is solved and I think this is a beatifull solution, I've a question related to the code. Is it true that You could also make input fields this way inside a listview? (by changing $LVS_EX_checkboxes) _GUICtrlListView_SetExtendedListViewStyle( $idListView2, $LVS_EX_CHECKBOXES ) Not that I need it but the answer expands mine knowledge on the matter Also tried a couple of things to have a inputfield at the end of the row but couldn't make a input field inside. in the helpfiles din't find any related $iExStyle or did i din't understand the code provided ? as finishing touch god created the dutch Link to comment Share on other sites More sharing options...
seadoggie01 Posted October 17, 2019 Share Posted October 17, 2019 I won't say it's not possible, but I think you'll get better results (and don't have to care? ) with Melba23's GUIListViewEx UDF, he has editable items in the ListView with lots more functionality. (I don't know how he does it, but it's awesome) All my code provided is Public Domain... but it may not work. Use it, change it, break it, whatever you want. Spoiler My Humble Contributions:Personal Function Documentation - A personal HelpFile for your functionsAcro.au3 UDF - Automating Acrobat ProToDo Finder - Find #ToDo: lines in your scriptsUI-SimpleWrappers UDF - Use UI Automation more Simply-erKeePass UDF - Automate KeePass, a password managerInputBoxes - Simple Input boxes for various variable types Link to comment Share on other sites More sharing options...
LarsJ Posted October 17, 2019 Share Posted October 17, 2019 With _GUICtrlListView_EditLabel it's possible to edit label texts. However, it has nothing to do with the subitem checkbox technique. Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
dmob Posted October 18, 2019 Share Posted October 18, 2019 Ii's certainly possible. I have successfully combined the code I posted above with Melba's UDF: seadoggie01 1 Link to comment Share on other sites More sharing options...
seadoggie01 Posted October 18, 2019 Share Posted October 18, 2019 Lol, I wasn't going to argue with LarsJ when I saw his name in the UDF, but I thought so All my code provided is Public Domain... but it may not work. Use it, change it, break it, whatever you want. Spoiler My Humble Contributions:Personal Function Documentation - A personal HelpFile for your functionsAcro.au3 UDF - Automating Acrobat ProToDo Finder - Find #ToDo: lines in your scriptsUI-SimpleWrappers UDF - Use UI Automation more Simply-erKeePass UDF - Automate KeePass, a password managerInputBoxes - Simple Input boxes for various variable types Link to comment Share on other sites More sharing options...
dmob Posted October 18, 2019 Share Posted October 18, 2019 Just proves the versatility of AutoIt (not to mention the brilliance of the UDF's and their authors) seadoggie01 1 Link to comment Share on other sites More sharing options...
LarsJ Posted October 19, 2019 Share Posted October 19, 2019 (edited) FMS asks if you can make input (edit) fields in the same way that you can make checkboxes by simply replacing the $LVS_EX_CHECKBOXES style with another extended listview style. I'm answering that the code to make edit fields has nothing to do with the code to make checkboxes. It's different types of code. And that's correct. So you cannot simply change the listview style. But I'm not saying that it isn't possible to edit the text in a listview cell that contains a checkbox or subitem checkbox. You can use _GUICtrlListView_EditLabel to edit label texts. To use this function you probably need about 20 codelines. But an external UDF with 5,000 codelines that's a lot of code if you only need 20 lines. Edited October 19, 2019 by LarsJ Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
seadoggie01 Posted October 20, 2019 Share Posted October 20, 2019 I misread your post, I apologize. I thought you were saying that the UDF had nothing to do with the post. I should stop speed reading. 🙄 On the other hand, I would rather use a UDF with 5000 lines than write 14 of the 20 lines needed and miss some bugs It's personal preference though. All my code provided is Public Domain... but it may not work. Use it, change it, break it, whatever you want. Spoiler My Humble Contributions:Personal Function Documentation - A personal HelpFile for your functionsAcro.au3 UDF - Automating Acrobat ProToDo Finder - Find #ToDo: lines in your scriptsUI-SimpleWrappers UDF - Use UI Automation more Simply-erKeePass UDF - Automate KeePass, a password managerInputBoxes - Simple Input boxes for various variable types 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