Interface DIc Property meaning() As String Property word() As String End Interface <serializable()> Public Class Class1 Private word As String Private meaning As String Public Sub New(ByVal cWord As String, ByVal cMeaning As String) word = cWord meaning = cMeaning End Sub Public Property pWord() As String Get Return Me.word End Get Set(ByVal value As String) Me.word = value End Set End Property Public Property pMeaning() As String Get Return Me.meaning End Get Set(ByVal value As String) Me.meaning = value End Set End Property Public ReadOnly Property Full() As String Get Return Me.word & " " & Me.meaning End Get End Property End Class
Imports ClassLibrary1.Class1 Imports ClassLibrary1 Imports System.IO Public Class Form1 Dim bf As New BinaryFormatter Dim Ar As New ArrayList Dim BS As New BindingSource Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Ar.Add(New Class1(TextBox1.Text, TextBox2.Text)) Ar.Add(New Class1("B", "kidsfjao")) bs.DataSource = Ar ComboBox1.DataSource = bs ComboBox1.DisplayMember = "pWord" TextBox2.DataBindings.Add("Text", bs, "pMeaning", True) BindingNavigator1.BindingSource = bs End Sub End Class
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)