SendMessage: ListView API Messages, Styles, and Notifications
Definitions of the various ListView members in commctrl.h.
ListView Demo Project
A four part demo to take you from returning a simple browse file
path to populating the ListView with files, file details, and image
icons.
ListView Extended Style demo code - revised September 1998
Each article below builds on the previous one, so only the code
related to that article is presented for simplicity. The routines
can be applied to the ListView demo code above, or integrated into
an existing ListView project.
SendMessage: Auto-size ListView Column Width
Using SendMessage to cause the ListView to maximize its column
display. Feb 12.2000
Pure VB: Create a Ledger-Style Listview
Report Background
Applying row background colour without subclassing.
Feb 5.2002 Corrected bug Feb 21.2002
Pure VB: Create a Ledger-Style Listview
Report Background with Custom Height
Applying row background colour without subclassing, adding the
ability to specifying the number of rows in the 'ledger'.
Feb 20.2002 Corrected bug Feb 21.2002
SendMessage: Add a Background Image to a ListView
Add an image or coloured background to a ListView!
June 19.1998
SendMessage: Perform Hit Testing in ListViews
Using SendMessage and LVM_SUBITEMHITTEST to retrieve the HitTest
info from the ListView control. Mar 01.2000
SendMessage: Determine a ListView's Visible Item Count
One-line routine that returns the number of items totally visible in
the control.
Aug 27.1999
Pure VB: Highlight a Listview Report
Column
Using the picture box technique, demonstrates highlighting a column
in report view. Feb 20.2002 Corrected bug Feb
21.2002
WM_NOTIFY: Track Highlighted
ListView Column Width Changes via Subclassing
Using the picture box technique, demonstrates highlighting a column in
report view while tracking and maintaining its width. Feb
20.2002
SendMessage:
Automatically Track & Select ListView Items
API code to track mouse movement, highlighting the item under the
cursor, and automatically selecting it with delay.
SendMessage: Add ListView Check Boxes
API code to add a checkbox to the left of the report-view icon, and
the code to retrieve the checked items and list item text.
Now contains the correct declaration for the LV_ITEM data type.
SendMessage: Add Images to a ListView Header
The ListView API method to programmatically set, clear and toggle a
ListView column header image, and to enable hot tracking across the
column header.
CreateFontIndirect: Change ListView Header Text Style
Use the ListView APIs to change the header text style.
SendMessage: Determine Selected ListView
ListItems
LVM_GETSELECTEDCOUNT and LVM_GETNEXTITEM to the rescue! Sept
16.2002
SendMessage: Clicking ListView White
Space to De-select Items
Using SendMessage and LVM_SUBITEMHITTEST, code to determine when the
user clicks off a ListItem, and how to deselect the item. Sept
16.2002
SendMessage: Determine Positions of Re-Ordered ListView Columns
API method to determine how the user has rearranged the columns when
the drag & drop ColumnHeader option is enabled.
SendMessage: Display ListView Grid Lines
API code to segment the ListView data with gridlines.
SendMessage: ListView Select / Deselect All
May 5.1999
API call to select or deselect all ListItems without using a loop.
SendMessage: Reorder ListView Columns Programmatically
Use the API to reorder the report view columns via code. March
8.1999
SendMessage: Reposition ListView Columns
API code to enable drag & drop of the ListView main and SubItem
report-view columns to facilitate user-selected layout.
SendMessage: Enable ListView FullRowSelect
API code to cause a selected ListView item to select the entire row.
SendMessage: Set ListView Flat Header Style
The API method to enable/remove a flat appearance to a ListView
header.
SendMessage: Indent ListView ListItems
Using the LV_ITEM Indent member to adjust a ListView item's indent.
Oct 29.1999
SendMessage: ListView Subitem Icons
API code to display the associated icon in each column of the
populated ListView.
SendMessage: Toggle ListView Check Box State
Finally, the ListView API method to programmatically set or clear a
ListView item's checkbox.
SendMessage: HTML-Like Tracking Effects in a ListView
Two API code methods to highlight & underline the current item
without selection.
SendMessage: Simulate 'TopIndex' in
ListViews
Replicate a list box TopIndex property in a ListView control.
Jan 25.2004
SendMessage:
Controlling a ListView Sort Using Callbacks
Use the AddressOf operator to add extended sorting functionality
to ListView columns.
Sept 5.1997
WM_VSCROLL: Subclassing Listview Scrollbar Messages
Demonstrates detecting scrollbar action within a listview, and
scrolling a second control, modifying the scroll message, or
discarding the message Aug 29.2000
WM_NOTIFY: Detect Sizing Notifications from a ListView ColumnHeader
Detect column resizing, header repositioning, clicks and
double clicks on the ListView header.
Aug 22.1999
SendMessage: Using ListView API Check Boxes
A set of ListView API methods to programmatically set and clear a
single ListView item's checkbox, set and clear all checkboxes,
invert the state of checked/unchecked boxes, launch a selected item,
and launch a checked item.
Pure VB: Link a TreeView and Listview Together via their Tag
Properties
How to use the Tag property to allow a TreeView selection to
highlight a corresponding ListView item.
June 21.1998 |