| Description: | YCC List Control is a generic utility Microsoft .NET control that handles many of the common operations associated with text lists |
| Language: | Visual Basic.NET 2008 |
| Screenshot: | ![]() |
| Virus Scan: |
Introduction
YCC List Control is an open source user control created in Microsoft Visual Basic.NET 2008 which handles many of the common tasks associated with a list of data. YCC List Control is a graphical interface to open, save, and edit data which is then displayed in a standard ListBox control. Additionally, the programmer is able to programmatically edit data, import data, and change various aspects of the ListBox such as the currently highlighted entry.
The features of YCC List Control are:
- Change the text and color of the GroupBox that contains the ListBox
- Increment and decrement the select index
- Graphically open, append, and save a list
- Graphically add or remove an item from the list
- Programmatically get, set, or delete the currently selected item
- Programmatically replace, add, or delete any item based on item text
- Import a data set (array of values) into the ListBox programmatically
- Various events showing what operations have been completed
Rational and Background
On more than one occasion I have found myself needing a general use control that imported and manipulated a list of data. It seems that most of my projects involve a list of names, passwords, or accounts so after about the third time of recreating the same functionality in individual programs, I decided to create a general utility control that could be used for all of these projects and even future projects. Since its initial creation, YCC List Control has had many features added and tweaked but the basic principal remained the same.
YCC List Control is a ListBox and ToolStrip inside a GroupBox. The ListBox is standard but the ToolStrip has been modified to remove the line that usually separates itself from the main content. Within the ToolStrip there are buttons to add a list, append to a list (keep what is there and add to it), save what is currently in the list, add a value to the list, and remove the selected value. With each operation a line count is kept and displayed in the GroupBox text. All of these operations are meant for the end-user to load their lists into the parent program and then have the data accessible to other parts of the parent program.
Once the data is in the parent program, the programmer must have a way to retrieve and use the data. A common operation is to get the currently selected item and then increment the selected index for the next get operation. This can be accomplished with the following two lines.
txtGetCurret.Text = YLCMain.GetSelectedValue
YLCMain.IncrementSelectedIndex()
There are also inverses to the above operations and a programmer can also set the current item value or decrement the selected index.
Another common operation is to remove a particular value from the list once it is found that the item in question is no longer valid. This can be accomplished by the following.
YLCMain.Delete(txtDeleteValue.Text)
Other operations such as deleting the current item, replacing an item with another item, and adding an item can be performed programmatically. Another feature of YCC List Control is the data is also kept in a string array separate from the ListBox. This allows the programmer to retrieve and import the data as a string array if it better fits the programming model.
The most well known use of the YCC List Control is in YCC Yahoo! Bot Maker which uses the control in the proxy list. Here the YCC List Control gets the selected proxy from the list and then increments the selected index for the next proxy. If an error occurs with the proxy, that proxy is removed from the list.
Usage
YCC List Control is a standard user control and can be added to any project programmatically or through the Visual Studio Designer. When in design mode, make sure the Toolbox is showing by selecting View and then Toolbox (crtl + alt + x). Right click on the Toolbox and select Choose Items… A Choose Toolbox Items dialogue pops up and under the .NET Framework Components tab, click Browse. Select the location of YCC List Control/bin/Debug/ YCC List Control.dll and then click Open. You will notice a new item in the Toolbox named YCC List Control and you can now use it like any other form control.
Requirements
License Agreement
The software, YCC List Control, is distributed under the Creative Commons GNU General Public License which can be found at http://creativecommons.org/licenses/GPL/2.0/ The major points follow:
- No commercial distribution without permission.
- You are allowed to modify the program and source, all I ask is you keep the original credit.
- If you do modify the program it will fall under the same license agreement.
I have chosen this license to allow users to do pretty much what they want with the program. The big thing that I ask is please don't redistribute this software without acknowledgment to YCC and a link back to http://ycoderscookbook.com. I would love to hear what you think about the program and if you have made useful changes. A forum for YCC List Control can be found at http://ycoderscookbook.com/forums/viewforum.php?f=20 under the Programs directory.
As with any piece of freeware, I have made every effort to make the software useable and friendly. With that said I take no responsibility for damage created by this program or the user’s actions. The user takes full responsibility for their actions.
Source and Executible
Full source code is provided. Please feel free to modify YCC List Control as long as you read and understand the license agreement.




