--- title: "How to: Implement the IListSource Interface" ms.date: "03/30/2017" dev_langs: - "csharp" - "vb" helpviewer_keywords: - "data binding [Windows Forms], implementing" - "IListSource interface" ms.assetid: 63ce27aa-2e23-4fbd-8228-0c1726f6c421 --- # How to: Implement the IListSource Interface Implement the interface to create a bindable class that does not implement but instead provides a list from another location. ## Example The following code example demonstrates how to implement the interface. A component named `EmployeeListSource` exposes an for data binding by implementing the method. [!code-csharp[System.ComponentModel.IListSource#1](~/samples/snippets/csharp/VS_Snippets_Winforms/System.ComponentModel.IListSource/CS/EmployeeListSource.cs#1)] [!code-vb[System.ComponentModel.IListSource#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.ComponentModel.IListSource/VB/EmployeeListSource.vb#1)] [!code-csharp[System.ComponentModel.IListSource#10](~/samples/snippets/csharp/VS_Snippets_Winforms/System.ComponentModel.IListSource/CS/Employee.cs#10)] [!code-vb[System.ComponentModel.IListSource#10](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.ComponentModel.IListSource/VB/Employee.vb#10)] [!code-csharp[System.ComponentModel.IListSource#100](~/samples/snippets/csharp/VS_Snippets_Winforms/System.ComponentModel.IListSource/CS/BusinessObjectBase.cs#100)] [!code-vb[System.ComponentModel.IListSource#100](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.ComponentModel.IListSource/VB/BusinessObjectBase.vb#100)] [!code-csharp[System.ComponentModel.IListSource#1000](~/samples/snippets/csharp/VS_Snippets_Winforms/System.ComponentModel.IListSource/CS/Form1.cs#1000)] [!code-vb[System.ComponentModel.IListSource#1000](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.ComponentModel.IListSource/VB/Form1.vb#1000)] ## Compiling the Code This example requires: - References to the System.Drawing and System.Windows.Forms assemblies. ## See also - - - - - [Data Binding and Windows Forms](data-binding-and-windows-forms.md)