Click here to Skip to main content
6,595,854 members and growing! (18,683 online)
Email Password   helpLost your password?
Languages » VB.NET » General     Intermediate License: The Code Project Open License (CPOL)

VB.NET Class Library: ListBox Extension

By George B Gilbert

A class that extends the ListBox control by adding item tags, providing a simple way to move items up and down, and adding multiple sorting options.
VB, Windows, .NET, Visual Studio, Dev
Posted:22 Jun 2006
Updated:22 Jun 2006
Views:56,862
Bookmarked:49 times
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
10 votes for this article.
Popularity: 4.41 Rating: 4.41 out of 5

1

2
2 votes, 20.0%
3
2 votes, 20.0%
4
6 votes, 60.0%
5

Demo project

Contents

Introduction

The ListBox Items (LI) class library (2gs_listboxitems.dll) houses one public and one private class.

  • C_ListboxItems ... instantiates a data source that is bound to a ListBox control. This class has a constructor, and exposes six methods and eleven properties.
  • C_CloneTable ... used within the C_ListboxItems class to create a copy of the bound DataTable.

The demo project is designed to clearly highlight all of the features of the LI class. Items in a ListBox can be added, removed, inserted, and cleared easily without using ListBox methods. The same is true of setting item Text and Tag properties. In addition, you can readily see on the demo program window that there are many options available for sorting the contents of a ListBox.

Background

When I need to add a list of items to a form, my preference was to use a ListBox. This control is, in my opinion, much simpler to use than a ListView when a simple list of items is needed. The reason I normally end up using a ListView instead of the simpler ListBox is that the latter control does not have a Tag property for each listed item. ListBoxes only have a Tag property for the control.

In the project I'm currently working on, there are several lists of items that each have an associated key value. As is my normal course, I started out using a ListView control instead of my preferred ListBox. This approach did not work because the ListView began behaving erratically. It just would not do what I needed done. This forced me to take a long look at how item tags could be added to a ListBox. The result was the Listbox Items class.

The Listbox Items Class

The purpose of the LI class is to create a DataTable that can be bound to a ListBox as a data source. The class exposes the methods and properties needed to manage the items shown in the ListBox, and to extend the ListBox with item tags, up and down methods, plus several options for sorting the ListBox contents. The class accomplishes everything that needs to be done to the items in the ListBox, by manipulating the bound DataTable.

Since the methods and properties used to manage the ListBox contents are housed in the LI class, none of the methods, and only one of the ListBox properties are used. Once the class DataTable has been bound to the control via the ListBox's DataSource and DisplayMember properties, the ListBox fades into the background. The sole ListBox property that is used is SelectedIndex. This index value is the link between items in the ListBox and their corresponding rows in the bound DataTable.

Constructor

The C_ListboxItems class has one constructor that accepts no parameters. The constructor's reason for being is to create the DataTable's schema. The DataTable has two columns: one for the ListBox item text, and one for each item's Tag property.

#Region " Members "

    '** Storage for properties


    Private _dataTable As New DataTable
    Private _sorted As Boolean = False
    Private _sortedOnTag As Boolean = False
    Private _sortCaseSensitive As Boolean = False
    Private _sortAscending As Boolean = True

    '** Constants


    Private strTag As String = "Tag"
    Private strListText As String = "ListText"

#End Region

#Region " Constructor "
    Public Sub New()
        '------------------------------------------------


        '     Date    Developer            Code Change


        '  ---------- -------------------- --------------


        '  06/02/2006 G Gilbert            Original code


        '------------------------------------------------



        '------------------------------------------------


        ' Build the datatable's schema


        '------------------------------------------------


        With _dataTable
            For i As Integer = 0 To 1
                Dim newColumn As New DataColumn
                Select Case i
                    Case 0 : newColumn.ColumnName = strTag
                    Case 1 : newColumn.ColumnName = strListText
                End Select
                .Columns.Add(newColumn)
                newColumn = Nothing
            Next
        End With

    End Sub
#End Region

Methods

The C_ListboxItems class exposes six methods. They are listed here in alphabetical order.

Method Parameters Description
Add String, (Optional) String Add an item to the DataTable and, thereby, the ListBox. The first parameter is the item's Text property. Optionally, the item's Tag property can also be added via the second parameter. Returns the index of the added item. The returned index is correct even when the ListBox is sorted. If the add fails for any reason, -1 is returned.
Clear None Remove all rows from the DataTable and, thereby, the ListBox.
InsertAt Integer, String, (Optional) String Insert a row into the DataTable at the passed index and, thereby, the ListBox. The second parameter is the item's Text property. Optionally, the item's Tag property can also be set via the third parameter. Returns the index of the inserted item. The returned index is correct even when the ListBox is sorted. If the insert fails for any reason, -1 is returned.
MoveDown Integer, (Optional) Integer Move the indexed DataTable row (ListBox item) down by the number of passed rows (defaults to one row). This method is disabled when sorting is turned on. Returns the index of the moved row in its new position. If the passed index is out of range, or sorting is turned on, -1 is returned.
MoveUp Integer, (Optional) Integer Move the indexed DataTable row (ListBox item) up by the number of passed rows (defaults to one row). This method is disabled when sorting is turned on. Returns the index of the moved row in its new position. If the passed index is out of range, or sorting is turned on, -1 is returned.
RemoveAt Integer Remove a row from the DataTable (ListBox). If the passed index is out of range, or any other exception occurs, the DataTable is not changed.

Properties

The C_ListboxItems class exposes eleven properties. They are listed here in alphabetical order.

Property Variable Type Set Value (=) or (Parameters) Description
BottomIndex Integer N/A Get the index of the highest indexed item in the ListBox. Returns -1 when the ListBox is empty.
DataTable DataTable N/A Exposes the DataTable.
ItemCount Integer N/A Get the number of rows in the DataTable (the count of ListBox items).
NoItems Boolean N/A Get a flag indicating whether the ListBox is empty.
SortAscending Boolean = Boolean Get/set whether any sorting is done in ascending sequence. If either the Sorted or SortedOnTag properties are set to True, the DataTable, and, thereby, the ListBox items are re-sorted.
SortCaseSensitive Boolean = Boolean Get/set whether the sort of the ListBox is case sensitive. If either the Sorted or SortedOnTag properties are set to True, the DataTable, and, thereby, the ListBox items are re-sorted.
Sorted Boolean = Boolean Get/set whether the items in the ListBox are sorted on the Text property. Mutually exclusive with the SortedOnTag property. When this property is set to True, the SortedOnTag property is set to False, then the DataTable, and, thereby, the ListBox items are sorted on the Text property.
SortedOnTag Boolean = Boolean Get/set whether the items in the ListBox are sorted on the Tag property. Mutually exclusive with the Sorted property. When this property is set to True, the Sorted property is set to False, then the DataTable, and, thereby, the ListBox items are sorted on the Tag property.
Tag String (Integer)
= String
Get/set the Tag property of the indexed ListBox item. If the index is out of range, or any other exception occurs during a Get, an empty string is returned. If the index is out of range for a Set, the Tag property is not changed. After a successful Set, if the SortedOnTag property is True, the DataTable, and, thereby, the items in the ListBox are re-sorted on the Tag property.
Text String (Integer)
= String
Get/set the Text property of the indexed ListBox item. If the index is out of range, or any other exception occurs during a Get, an empty string is returned. If the index is out of range for a Set, the Text property is not changed. Nor is the Text property changed if an empty string is passed. After a successful Set, if the Sorted property is True, the DataTable, and, thereby, the items in the ListBox are re-sorted on the Text property.
TextColumnName String N/A Get the name of the DataTable column to be used for the ListBox DisplayMember property.

Using the Class Library

Follow these steps to make the 2gs_listboxitems class library available in a project:

  1. Copy the DLL (2gs_listboxitems.dll) to the project's BIN folder.
  2. In the VS Solution Explorer, add the DLL to the project's References.

At the top of each form class in which the C_ListboxItems class is consumed, add this statement:

Imports _2gs_listboxitems

Sample Code

These code samples are all from the demo project. The assumption in this section is that the LI class has been made available in the project as per the steps in the "Using the Class Library" section above.

Binding the Listbox to the DataTable

The first steps in using the LI class are to add a Windows Form to a project and then add a ListBox to the Form. In the demo project, the ListBox is named lstDemo. With the ListBox is in place, an LI object is instantiated in the Form's Declarations section.

#Region " Members "
    Private li As New C_ListboxItems
#End Region

The ListBox is then bound to the LI object's DataTable property in the Form's Load event. In the demo project, after the ListBox is bound to the exposed DataTable, the ListBox is immediately populated with a few sample items using the LI object's Add method. Note that both the Text and Tag properties are being set at the same time.

#Region " ... Load "
    Private Sub F_ListboxItems_Load(ByVal sender As System.Object, _
                                    ByVal e As System.EventArgs) _
                                    Handles MyBase.Load
        '------------------------------------------------


        '     Date    Developer            Code Change


        '  ---------- -------------------- --------------


        '  06/02/2006 G Gilbert            Original code


        '------------------------------------------------



        '------------------------------------------------


        ' Bind the listbox to the C_ListboxItems object


        '------------------------------------------------


        With lstDemo
            .DataSource = li.DataTable
            .DisplayMember = li.TextColumnName
        End With

        '------------------------------------------------


        ' Add a few demo items to the listbox and set


        ' their tags


        '------------------------------------------------


        With li
            .Add("one", "001")
            .Add("Two", "002")
            .Add("three", "003")
            .Add("Forty three", "043")
            .Add("eighteen", "018")
            .Add("Hundred", "100")
        End With
        DisplayTag()

    End Sub
#End Region

Henceforth, the only reference to the ListBox is when the index of the selected item is needed. The ListBox's SelectedIndex property, when greater than or equal to zero, points to the row in the bound DataTable that corresponds to the selected ListBox item.

The Add Button

When the Add button is clicked in the demo project, the user is queried for the text of the new ListBox item. Then the user has the option of entering a tag value. When the item is added to the ListBox with the Add method, one line of code is needed to both add the item and then select that new item in the ListBox. The correct item is selected whether or not either of the sort properties are turned on. (If, after the add is done, when the ListBox is sorted and there are two or more items in the ListBox with identical Text and Tag properties, the bottommost identical item will be selected.)

#Region " ... Add "
    Private Sub btnAdd_Click(ByVal sender As System.Object, _
                             ByVal e As System.EventArgs) _
                             Handles btnAdd.Click
        '-----------------------------------------------


        '     Date    Developer            Code Change


        '  ---------- -------------------- -------------


        '  06/02/2006 G Gilbert            Original code


        '-----------------------------------------------



        '------------------------------------------------


        ' Ask the user for the listbox item text to use


        ' in the new row


        '------------------------------------------------


        Dim addText As String
        addText = InputBox("Enter text for new item", _
                           "Add", _
                           "New item text")

        '------------------------------------------------


        ' If the user cancelled, bail. Otherwise, query


        ' for the tag property.


        '------------------------------------------------


        If addText.Length <= 0 Then
            lstDemo.Focus()
            Exit Sub
        End If
        Dim addTag As String
        addTag = InputBox("Enter a tag property for the new item", _
                          "Add")

        '------------------------------------------------


        ' Add and select the new listbox item


        '------------------------------------------------


        With lstDemo

            '** Do the Add


            .BeginUpdate()
            .SelectedIndex = li.Add(addText, addTag)
            .EndUpdate()

            '** Shift the focus back to the listbox


            .Focus()

        End With

    End Sub
#End Region

The Remove Button

Before the selected item is removed from the ListBox, the user is queried to ensure they intend to delete the selected item. Since the selected ListBox item is being removed, the Remove method does not return an index. What happens after the removal is entirely up to the programmer. In the demo project, if there are items remaining in the ListBox after the removal, the first item is selected. The NoItems property of the LI object is used to determine if there are any items remaining in the ListBox.

#Region " ... Remove "
    Private Sub btnRemove_Click(ByVal sender As System.Object, _
                                ByVal e As System.EventArgs) _
                                Handles btnRemove.Click
        '-----------------------------------------------


        '     Date    Developer            Code Change


        '  ---------- -------------------- -------------


        '  06/02/2006 G Gilbert            Original code


        '-----------------------------------------------



        '-----------------------------------------------


        ' Remove the selected row from the listbox


        '-----------------------------------------------


        If lstDemo.SelectedIndex > -1 Then

            '** Ensure the user is serious


            If MessageBox.Show("Delete the selected row from the listbox?", _
                               "Remove", _
                               MessageBoxButtons.YesNo, _
                               MessageBoxIcon.Question, _
                               MessageBoxDefaultButton.Button2) = _
                               DialogResult.Yes Then

                With lstDemo

                    '** Remove the item from the listbox


                    .BeginUpdate()
                    li.RemoveAt(.SelectedIndex)
                    .EndUpdate()

                    '** Select the first row in the


                    '** listbox if there are any items


                    '** remaining


                    If li.NoItems Then

                        '** The listbox is now empty


                        lblTag.Text = tagCaption

                    Else

                        '** There are items remaining


                        .SelectedIndex = 0
                        DisplayTag()

                    End If

                End With

            End If

        Else

            '** No item in the listbox is selected


            If li.NoItems Then

                '** The listbox is empty


                Beep()

            Else

                '** Remind the user that an item


                '** has to be selected first


                ShowReminder("Remove")

            End If

        End If

        '------------------------------------------------


        ' Shift the focus back to the listbox


        '------------------------------------------------


        lstDemo.Focus()

    End Sub
#End Region

The Insert Button

The Insert button in the demo project does not query the user for either the Text or Tag properties of the item being inserted. Instead, the user is asked to provide the index where the new item is to be inserted. The default index in the initial query is set to the index of the selected ListBox item. The Text and Tag properties of each inserted ListBox item are set to hard-coded values, which, while not an accepted practice, works in the demo.

One statement is used to both insert the new ListBox item and then select that new item in the ListBox. The correct item is selected in the ListBox whether or not either of the sort properties is turned on. (If, after the insert is done, when the ListBox is sorted and there are two or more items in the ListBox with identical Text and Tag properties, the bottommost identical item will be selected.)

#Region " ... Insert "
    Private Sub btnInsert_Click(ByVal sender As System.Object, _
                                ByVal e As System.EventArgs) _
                                Handles btnInsert.Click
        '------------------------------------------------


        '     Date    Developer            Code Change


        '  ---------- -------------------- --------------


        '  06/02/2006 G Gilbert            Original code


        '------------------------------------------------



        '------------------------------------------------


        ' Default the query index to the index of the


        ' selected listbox item


        '------------------------------------------------


        Dim reply As String
        Select Case lstDemo.SelectedIndex
            Case Is < 0 : reply = ""
            Case Else : reply = lstDemo.SelectedIndex.ToString
        End Select

        '------------------------------------------------


        ' Build the message for the inputbox


        '------------------------------------------------


        Dim msg As String
        Dim sb As New StringBuilder("")
        With sb
            .Append("Enter the index for the inserted item")
            .Append(ControlChars.CrLf)
            .Append(ControlChars.CrLf)
            .Append("(A positive or negative number, only)")
            msg = .ToString
        End With
        sb = Nothing

        '------------------------------------------------


        ' Loop until either the user enters a number or


        ' cancels


        '------------------------------------------------


        Do
            reply = InputBox(msg, "Insert", reply)
            If IsNumeric(reply) _
            OrElse reply.Length <= 0 Then
                Exit Do
            Else
                MsgBox("Enter a positive or negative number, only!", _
                       MsgBoxStyle.Critical, _
                       "Insert Error")
            End If
        Loop

        '------------------------------------------------


        ' If the user did not cancel, insert and select


        ' the new row


        '------------------------------------------------


        If reply.Length > 0 Then

            With lstDemo
                .BeginUpdate()
                .SelectedIndex = li.InsertAt(CType(reply, Integer), _
                                             "Inserted Text", _
                                             "Inserted Tag")
                .EndUpdate()
            End With

        End If

        '------------------------------------------------


        ' Shift the focus back to the listbox


        '------------------------------------------------


        lstDemo.Focus()

    End Sub
#End Region

The LI object's Insert method will accept any numeric index. If the passed index is out of range, the method interprets the out of range value as an insert at either the beginning or end of the DataTable row, as appropriate.

The Clear Button

There is nothing fancy about the C_ListboxItems Clear method. In the demo project, after the user has confirmed that all of the ListBox items are to be deleted, all ListBox items are removed from the bound DataTable, and, thereby, the ListBox, with one statement.

#Region " ... Clear "
    Private Sub btnClear_Click(ByVal sender As System.Object, _
                               ByVal e As System.EventArgs) _
                               Handles btnClear.Click
        '------------------------------------------------


        '     Date    Developer            Code Change


        '  ---------- -------------------- --------------


        '  06/02/2006 G Gilbert            Original code


        '------------------------------------------------



        '------------------------------------------------


        ' Delete all items from the listbox (if there


        ' are any)


        '------------------------------------------------


        If li.NoItems Then

            '** The listbox is empty


            Beep()

        Else

            '** Ensure the user is serious


            If MessageBox.Show("Delete all items from the listbox?", _
                               "Clear", _
                               MessageBoxButtons.YesNo, _
                               MessageBoxIcon.Question, _
                               MessageBoxDefaultButton.Button2) = _
                                          DialogResult.Yes Then

                li.Clear()
                lblTag.Text = tagCaption

            End If

        End If

        '------------------------------------------------


        ' Shift the focus back to the listbox


        '------------------------------------------------


        lstDemo.Focus()

    End Sub
#End Region

The Change Text Button

When the LI object's Text property is changed and the Sorted property is set to True, the items in the ListBox are re-sorted. This could result in the originally selected ListBox item no longer being selected. In the demo project, this means that after the Text property has been changed, the displayed tag value may have to be updated.

The code behind the Change Tag button is very similar to the Change Text code. Only the Change Text code is illustrated:

#Region " ... Change Text "
    Private Sub btnChangeText_Click(ByVal sender As System.Object, _
                                    ByVal e As System.EventArgs) _
                                    Handles btnChangeText.Click
        '------------------------------------------------


        '     Date    Developer            Code Change


        '  ---------- -------------------- --------------


        '  06/02/2006 G Gilbert            Original code


        '------------------------------------------------



        '------------------------------------------------


        ' Set the selected item's text property


        '------------------------------------------------


        If lstDemo.SelectedIndex > -1 Then

            '** Query the user for the new text using


            '** the old text as the default


            Dim reply As String = InputBox(
                                  "Enter new text for the selected item", _
                                  "Change Text", _
                                  li.Text(lstDemo.SelectedIndex))

            '** If the user did not cancel, proceed


            '** with the change


            If reply.Length > 0 Then

                '** Change the item's text property


                li.Text(lstDemo.SelectedIndex) = reply

                '** If the listbox is sorted on the


                '** Text property, refresh the tag


                '** display to ensure the displayed


                '** tag is in sync with the selected


                '** item


                If li.Sorted Then
                    DisplayTag()
                End If

            End If


        Else

            '** No item in the listbox is selected


            If li.NoItems Then

                '** The listbox is empty


                Beep()

            Else

                '** Remind the user that an item


                '** has to be selected first


                ShowReminder("Change Text")

            End If

        End If

        '------------------------------------------------


        ' Shift the focus back to the listbox


        '------------------------------------------------


        lstDemo.Focus()

    End Sub
#End Region

The Up and Down Buttons

In the demo project, the up and down buttons both call a procedure named MoveItem. The procedure's optional boolean parameter determines the direction of the move.

The LI object's MoveUp and MoveDown methods return a -1 if either the sorting is turned on or the move did not happen for any reason. In the MoveItem procedure, therefore, the sort status of the ListBox is tested first. If the sort property is turned on, a message is displayed, and no attempt is made to move the selected row. After a move is attempted, a -1 return can then be interpreted as an error.

#Region " ... MoveItem "
    Private Sub MoveItem(Optional ByVal moveUp As Boolean = True)
        '------------------------------------------------


        ' Move the selected item up/down one row


        '------------------------------------------------


        '     Date    Developer            Code Change


        '  ---------- -------------------- --------------


        '  06/12/2006 G Gilbert            Original code


        '------------------------------------------------



        '------------------------------------------------


        ' If either sorting is turned on, the move


        ' up/down methods are disabled


        '------------------------------------------------


        If li.Sorted _
        OrElse li.SortedOnTag Then

            MessageBox.Show("The listbox is sorted!", _
                            "Oops!", _
                            MessageBoxButtons.OK, _
                            MessageBoxIcon.Exclamation)

            '** Shift the focus back to


            '** the listbox and bail


            lstDemo.Focus()
            Exit Sub

        End If

        '------------------------------------------------


        ' If an item is selected, move the item 1 row


        ' in the requested direction


        '------------------------------------------------


        If lstDemo.SelectedIndex > -1 Then

            '** Move the selected item either


            '** up or down 1 row


            Dim newIndex As Integer
            With lstDemo
                .BeginUpdate()
                Select Case moveUp
                    Case True : newIndex = li.MoveUp(.SelectedIndex)
                    Case False : newIndex = li.MoveDown(.SelectedIndex)
                End Select
                .EndUpdate()
            End With

            '** Check if the move was successful


            Select Case newIndex

                Case -1

                    '** The move didn't happen


                    MessageBox.Show("The listbox item could not be moved", _
                                    "Oops!", _
                                    MessageBoxButtons.OK, _
                                    MessageBoxIcon.Exclamation)

                Case Else

                    '** Select the moved item


                    '** in its new position


                    lstDemo.SelectedIndex = newIndex

            End Select

        Else

            '** No item in the listbox


            '** is selected


            If li.NoItems Then

                '** The listbox is empty


                Beep()

            Else

                '** Remind the user that an


                '** item has be selected first


                Select Case moveUp
                    Case True : ShowReminder("Up Button")
                    Case False : ShowReminder("Down Button")
                End Select

            End If

        End If

        '------------------------------------------------


        ' Shift the focus back to the listbox


        '------------------------------------------------


        lstDemo.Focus()

    End Sub
#End Region

Sorting

There are a multitude of sorting options with the C_ListboxItems class. A ListBox sort is no longer limited to a case sensitive sort on the items' Text property. All of the LI class sorting options are illustrated in the demo project with a combination of five checkboxes and radio buttons. Any configuration of these controls can, depending on the ListBox contents, result in the ListBox items being placed in a different order.

Clicking the "case sensitive" and "ascending" checkboxes causes the respective LI object's properties, SortCaseSensitive and SortAscending, to be set. When either of these properties is changed, the contents of the bound ListBox are re-sorted.

Turning sorting on and off in the demo project results in a procedure named SetSorting being called. Sorting is turned on or off when the "Listbox is sorted" checkbox is clicked. Clicking on either the "on Text" or "on Tag" radio buttons changes the field on which the sort is based. These two radio buttons also call the SetSorting procedure.

#Region " ... SetSorting "
    Private Sub SetSorting()
        '------------------------------------------------


        ' Configure the listbox sorting


        ' per the sorting controls


        '------------------------------------------------


        '     Date    Developer            Code Change


        '  ---------- -------------------- --------------


        '  06/04/2006 G Gilbert            Original code


        '------------------------------------------------



        '------------------------------------------------


        ' Turn sorting on or off per the setting of the


        ' sort controls


        '------------------------------------------------


        Select Case True
            Case chkSorted.Checked

                '** Turn on the correct sorting


                '** (turning on either sort property


                '** turns the other off)


                lstDemo.BeginUpdate()
                Select Case True
                    Case rdoOnText.Checked : li.Sorted = chkSorted.Checked
                    Case rdoOnTag.Checked : li.SortedOnTag = chkSorted.Checked
                End Select
                lstDemo.EndUpdate()

                '** Refresh the tag display


                DisplayTag()

            Case Else

                '** No sorting ... ensure both


                '** properties are turned off


                With li
                    .Sorted = False
                    .SortedOnTag = False
                End With

        End Select

        '------------------------------------------------


        ' Shift the focus back to the listbox


        '------------------------------------------------


        lstDemo.Focus()

    End Sub
#End Region

Points of Interest

When I started to look at adding an item tag property to the ListBox control, my first inclination was to extend the ListBox with a user control that inherited the standard ListBox. Color me inadequate, but I couldn't make that approach work. I could not find a way to manipulate the Items collection in the base class. I think I researched that approach to death, but could not find a hint anywhere. Perhaps, someone out there who knows how to do that would be kind enough to write an article?

The standard DataTable InsertAt method can produce unpredictable results. That is why the LI class InsertAt method emulates instead of using the DataTable's InsertAt method.

The Listbox Items class was written specifically to extend the standard ListBox control. The class, however, can be bound to any control that has the DataSource and DisplayMember properties. For example, I use the the LI class to populate comboboxes.

Conclusion

After years, nay decades, of using a ListView control when a simple ListBox would suffice, I am very pleased to have the Listbox Items class available. I hope you find this ListBox extension as useful as I do.


Licensing and Limitation of Liability

You may use all code offered in this article any way you choose without restriction.

Under no circumstances, and under no legal theory, tort, contract or otherwise, will George Gilbert (hereafter referred to as "software author") or his licensors, be liable to the user of the Double Text library and all code offered in this article (hereafter referred to collectively as "article code") for any damages, including any lost profits, lost data, or other indirect, special, incidental or consequential damages, arising out of the use or inability to use the article code, and data or information supplied, even if the software author, his licensors or authorized dealer have been advised of the possibility of such damages, or for any claim by any other party.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

George B Gilbert


Member
Click here to see a complete list of my articles.
Occupation: Software Developer
Company: 2 Good Software
Location: United States United States

Other popular VB.NET articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 4 of 4 (Total in Forum: 4) (Refresh)FirstPrevNext
GeneralQuestion on the color of each row PinmemberKountree5:24 12 Oct '07  
GeneralRe: Question on the color of each row PinmemberGeorge B Gilbert7:28 12 Oct '07  
GeneralCan you implement this so it's multi-select? Pinmemberinbarg18:21 17 May '07  
GeneralRe: Can you implement this so it's multi-select? PinmemberGeorge B Gilbert5:43 18 May '07  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 22 Jun 2006
Editor: Sean Ewington
Copyright 2006 by George B Gilbert
Everything else Copyright © CodeProject, 1999-2009
Web18 | Advertise on the Code Project