ImageList and ListView Control in Visual Basic6.0


An ImageList Control contains a collection of images that can be used by other Windows Common Control ,Such as ListView,TreeView,TabStrip and ToolBar controls.It does not appeare on the form at run time.It serve as a container for icon that are accessed by other control such as ListView,TreeView,TabStrip and ToolBar controls.

A ListView  control displays data as ListItem objects.each ListItem object can have an optional icon associated with the Label of the object.

1.Click on “Start” . Then select “All Programs, Microsoft Visual Studio 6.0 and  Microsoft Visual Basic 6.0.” .

2. Select “Standard EXE” from the list in the New Project dialog box and click on “Open.” Click on “Project” on the menu bar, then select “Components” from the drop-down menu.

3. Scroll down the list in the box until Microsoft Windows Common Controls 6.0 (SP4) is visible. Click on the checkbox to select the component and then click on “OK.” All components show in the Toolbox.

4. Choose the “ListView1” control from the list of controls in the toolbox. Place the control on the form in Visual Basic.

5. Choose the “ImageList1” control from the list of controls in the toolbox. Place the control on the form in Visual Basic.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

6.Right click on Image control a popup menu is open choose properties option.A Properties Page is open .Click on Images Tab and insert the image as you want. If you want insert more than one picture then click on Insert Picture Button as shown in figure below:

 

 

 

 

 

 

 

 

 

7.Right click on the ListView1 Apopup menu is open choose properties option. A Properties page is open. Click on the imagelist tab and insert the imagelist1  then “OK” as shown in figure below:

 

 

 

 

 

 

 

 

 

 

 

8. Double click on Form1.Code window is open.Write code here as shown in figure:

 

 

 

 

 

 

 

 

 

 

9.Press <F5> to run the program.Output  is  shown below:

 

 

Comments are closed.