ListViewCtrl Control

Purpose

Creates a list view control in the current active form, window, or dialog.

Syntax

ListViewCtrl text$, id%, x, y, w, h[, style%]

text$:control text
id%:control identifier
x, y, w, h:iexp
style%:the control styles

Description

The control is a rectangle containing a list of strings (such as filenames) from which the user can select. The ListView control displays items using one of four different views. You can arrange items into columns with or without column headings as well as display accompanying icons and text.

The command creates a control without an OCX wrapper; so it and cannot be handled using properties, methods, and event subs. When used in a form the WM_COMMAND and WM_NOTIFY messages should be handled in the form's _MessageProc sub.

Example

Form frm

ListViewCtrl "Listbox", 10, 20, 20, 150, 200

Do

Sleep

Until Me Is Nothing

 

Sub frm_MessageProc(hWnd%, Mess%, wParam%, lParam%, retval%, ValidRet?)

Dim hdr As Pointer NMHDR

Switch Mess

Case WM_NOTIFY

Pointer(hdr) = lParam

Print hdr.idfrom

EndSwitch

EndSub

Type NMHDR

hwndFrom As Long

idfrom As Long

code As Long

EndType

Remarks

This command is particular useful for a dialog box in a GLL, because a GLL doesn't support OCX controls.

The ListView control is too complex to covered in full; for more information, loom at the following section of the MSDN website:

  • ListView

  • ListView Controls
  • With the general Control statement any control type can be created.

    See Also

    Control, AnimateCtrl, AutoCheckBox, AutoRadioButton, CheckBox, ComboBox, CText, Dialog, DefPushButton, EditText, GroupBox, HeaderCtrl, ListBox, ListViewCtrl, LText, ProgressCtrl, PushButton, RadioButton, RichEditCtrl, RText, ScrollBar, StatusCtrl, TabCtrl, ToolBarCtrl, TrackBarCtrl, TreeViewCtrl, UpDownCtrl

    {Created by Sjouke Hamstra; Last updated: 12/10/2014 by James Gaite}