Edit Listview Subitem In Vb6 Shell

26 views
Skip to first unread message

Elbio Gottlieb

unread,
Jun 26, 2024, 5:45:42 AM6/26/24
to uperchisna

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

Edit listview subitem in vb6 shell


Download Filehttps://t.co/n7MKXRpOx2



Col 1 subitems should remain white, but if col 2 value is lesser than col 1 value in same row, it should be coloured red, and if col 2 value is greater than col 1 value in same row it should be green.

Here is an example that shows the potential of this method. A virtual listview is filled with 10 columns and 10000/50000/100000 rows. All items are drawn with a random background color. I think it's pretty impressive.

Ok, so I have a listview on one form, and when a button is pressed it opens up a new form with the contents of the selected listview item and it's subitems in a series of textboxes. The user can then change the data in the textboxes and either press save to make the changes or cancel to close the window.What command would I use to change the selected listview item and subitems to whatever is in the boxes?

I've been developing an AutoIT script that handles Excel data to be inserted in SAP. In between, there is a GUI that, among others, uses a ListView. In the ListView the data is colored green if the value in BCE/RRN is identical to UpValue, but red if it is not. Upon double-clicking in BCE/RRN certain values get copied into UpValue. This means the value in BCE/RRN and UpValue becomes identical, so the color of the row should turn green... it does not however, and I know it will not by itself, and I have been experimenting with _GUICtrlListView_RedrawItems as well as with $CDDS_POSTPAINT and co, but to no avail. I prefer not the use a virtual listview or overly stuffed UDF's as that is beyond the scope of what I want to reach. I have also noticed the coloring flickers and the colors disappear (turn white) when clicking on a button (functionality removed), so I guess I may have an ordering problem in my code.

Sorry to say but there is a lot of unnecessary parts in your code. It would greatly help us if you could reduce it to its very strict minimum (should be about 40-50 lines of code). You could use this example to start with and to show us your issue.

Hi Lars, thanks for mentionning that. Having looked at your ListView UDF's, I can say you're an expert in this matter and I greatly appreciate your input. The UDF's are over my head, though, at this point. I've been using AutoIT for only a few months and I try to keep things as simple as possible.

I have been trying to figure out at what point and in which way I should be doing updates of the coloring. I've been inserting the _COLOR_ARRAY function at different stages, adding Redraw with Winapi, but I don't seem to capture exactly when and where it should happen.

Then try to find out why the _COLOR_ARRAY() function does not work automatically. It's connected to $aItems array. When arrays are used in this way, they must be updated when the listview subitem texts are updated.

I tried adding coloring indications to $NM_DBLCLK before, but not in the way you suggest. Quite interesting. But yes, because I use gets and sets for the subitem texts I may have an issue at that level.

Details
Each item appears on a separate line with further information about each item arranged in columns. The left-most column contains a small icon and label, and subsequent columns contain sub items as specified by the application. A column displays a header which can display a caption for the column. The user can resize each column at run time.

Tile
Each item appears as a full-sized icon with the item label and subitem information to the right of it. The subitem information that appears is specified by the application. This view is available only on Windows XP and the Windows Server 2003 family. On earlier operating systems, this value is ignored and the ListView control displays in the LargeIcon view.

This property indicates whether the user can reorder column headers in the Details view. Set this property to True, the users the order of the column header, by dragging the header to the desired location.

Set Width = -1, to adjust the width of the longest item in the column.
Set Width = -2, to auto size to the width of the column heading.
Note: When setting these special values, the control will automatically replace the Width with the calculated value.


[ColumnHeader] Add ([String] key, [String] text, [int] width, [HorizontalAlignment] textAlign, [int] imageIndex)
Creates and adds a column with the specified key, aligned text, width, and image index to the collection.


[ColumnHeader] Add ([String] key, [String] text, [int] width, [HorizontalAlignment] textAlign, [String] imageKey)
Creates and add s a column with the specified key, aligned text, width, and image key to the collection.

Enabling hot tracking will cause the Activation property to be set to OneClick and the HoverSelection property to be set to true. In addition, run-time label editing is not allowed when hot tracking is enabled.

Note: If an ImageList is specified in the StateImageList property and the CheckBoxes property is set to true, the images at index positions 0 and 1 in the ImageList are displayed instead of the check box. The image at index position 0 is displayed instead of the unchecked check box, and the image at index position 1 is displayed instead of the checked check box.

This property contains all the items that are selected in the ListView. Note: Each item is a ListViewItem object, so you will have to use the Text property to display the name. The ListViewItem will be addressed in Part 2.

LVA_ALIGNLEFT = Aligns items along the left edge of the window. LVA_ALIGNTOP = Aligns items along the top edge of the window. LVA_DEFAULT = Aligns items according to the ListView's current alignment styles (the default value). LVA_SNAPTOGRID = Snaps all icons to the nearest grid position.

Determine the index of the listview item at X,Y. X,Y are in client co-ordinates. In list context, returns a 2 member list, the first member containing the item index of the item under the tested position (or -1 of no such item), and the second member containing flags giving information about the result of the test:

Test to find which sub-item is at the position X,Y. X,Y are inclient-co-ordinates. Returns a 3 memeber list, giving the item number, subitem number and flags related to the test. the item number is -1 if no item or subitem is under X,Y. flags are a combination of:

7fc3f7cf58
Reply all
Reply to author
Forward
0 new messages