The control is automatically added to your Toolbox in Visual Studio and is automatically registered in the GAC (Global Assembly Cache) during installation of SftBox/NET. Please see Distributing SftBox/NET for information on how to distribute the control with your application.
.NET 10 projects use the control through its NuGet package, see Using SftBox/NET with .NET 10.
You can add an SftBox control to a form by dragging it from the Toolbox to the form.
If the control is missing from the Toolbox, please see "Manually Adding .NET Components To The Toolbox".
Once the control has been added to the form, you can access its property pages, product updates and product support page on the web using the control's smart tag. Edit Properties opens the property pages; Columns..., Items... and List... open them on that page.
In the designer, the header and footer cells of the list's added columns and rows, and of headers and footers made visible, show "Column 1", "Column 2", ... and "Footer 1", "Footer 2", ... when they have no contents, so new columns can be told apart. The texts are saved like any other cell text and can be changed in the property pages.
Place a Label in front of each combo box, with a text such as "&Country:". Screen readers use it as the combo box's name and its mnemonic moves the input focus to the combo box (see Accessibility).
In this example, we'll fill a combo box with countries and their capitals in two columns and show the chosen country in the form's caption.
VB
Imports Softelvdm.SftBoxNET
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
SftBox1.Columns.Count = 2
SftBox1.Columns(0).Width = 120
SftBox1.Items.Add(New String() {"Austria", "Vienna"})
SftBox1.Items.Add(New String() {"Belgium", "Brussels"})
SftBox1.Items.Add(New String() {"Canada", "Ottawa"})
SftBox1.DropDownWidthMode = DropDownWidthModeEnum.Optimal
SftBox1.SearchMode = SearchModeEnum.AutoComplete
End Sub
Private Sub SftBox1_SelectionCommitted(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SftBox1.SelectionCommitted
Text = SftBox1.Text
End Sub
End ClassC#
using System;
using System.Windows.Forms;
using Softelvdm.SftBoxNET;
namespace WindowsApplication1 {
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e) {
sftBox1.Columns.Count = 2;
sftBox1.Columns[0].Width = 120;
sftBox1.Items.Add(new string[] { "Austria", "Vienna" });
sftBox1.Items.Add(new string[] { "Belgium", "Brussels" });
sftBox1.Items.Add(new string[] { "Canada", "Ottawa" });
sftBox1.DropDownWidthMode = DropDownWidthModeEnum.Optimal;
sftBox1.SearchMode = SearchModeEnum.AutoComplete;
sftBox1.SelectionCommitted += sftBox1_SelectionCommitted;
}
private void sftBox1_SelectionCommitted(object sender, EventArgs e) {
Text = sftBox1.Text;
}
}
}This control has many properties and methods which you can use. This is a very simple example and doesn't even begin to exploit its capabilities. Please take a moment to familiarize yourself with the classes and objects offered by SftBox/NET. Also make sure to run the demo which is included with this product and take a look at the included samples.