Empty Text



Empty text feature is not supported in Better ListView Express.



This feature displays text when Better ListView is empty (does not contain any items and groups).

A typical use case is file browser, showing "This folder is empty." text when there are no files to display.

Better ListView can display such arbitrary text with custom font and color.

The text can be of multiple lines and is automatically trimmed if there is not enough space.

To add an empty text, simply set the EmptyText property value. You can simply pass a value of type String (there is an implicit conversion defined) or BetterListViewEmptyText (which allows for settings custom font and color).

An explicit conversion of BetterListViewEmptyText to String is also defined.

Sample Source Code

This minimalist sample shows how to easily set an empty text with default style:

C#

this.listView.EmptyText = "Text displayed on empty list.";

Visual Basic

ListView.EmptyText = "Text displayed on empty list."

This sample show setting empty text with custom font and color:

C#

// set empty text with custom style
this.listView.EmptyText = new BetterListViewEmptyText(
    "Text displayed on empty list.",
    new Font("Arial", 12.0f, FontStyle.Bold | FontStyle.Italic),
    Color.DarkBlue);

Visual Basic

' set empty text with custom style
ListView.EmptyText = New BetterListViewEmptyText (
    "Text displayed on empty list.",
    New Font ("Arial", 12.0F, FontStyle.Bold Or FontStyle.Italic),
    Color.DarkBlue)