Session #7
This session I demonstrate a very powerful UI component called a list view (TListView). The list view is one of the most powerful UI components, as it makes it easy to display lots of information very easily and makes the information easily accessible. It can even be made simple so computer beginners are not overwhelmed by the amount of data that is available. Everyone is familiar with the List View (even though most don't realize it), as it is the central component in Windows Explorer.This is the form at design time:
The application at runtime:
Detailed view | List view |
---|---|
![]() |
![]() |
Small icons view | Large icons view |
---|---|
![]() |
![]() |
The example is a modification of the previous List view example. I added a second TListView component. You can drag and drop between the two List Views, as well as drag and drop within a single list view.
This project demonstrates how to drag and drop between different windows (forms) of an application. In addition to the drag and drop stuff, I showed how to use the Anchor property of a component to properly resize a form.
The drag and drop demo shows how to copy items from one list box to another as well as move items from one list box to another. It also shows how to add items to a list box as well as insert into a particular position. The code for the two forms is trivial. The real work is done in the DragDropUtils.cpp support file.
The first form | The second form |
---|---|
![]() |
![]() |
Exercises