' Please use the following namespace
' Imports System.Windows.Forms;
' Imports GrapeCity.Win.Editors;
Public Sub FindStringFromGcMaskedComboBox()
' Creates the GcMaskedComboBox
Dim gcMaskedComboBox1 As New GcMaskedComboBox()
' Creates items for the GcMaskedComboBox.
Me.CreateItemsForFindString(gcMaskedComboBox1)
' The FindString can find out all the ListItem start with the "AA (Tel)" and following the format "[0] (Tel) [1]"
Dim collection As MatchedComboItemCollection = gcMaskedComboBox1.FindString("AA (Tel)", "[0] (Tel) [1]")
End Sub
Public Sub CreateItemsForFindString(ByVal gcMaskedComboBox As GcMaskedComboBox)
Dim listItem1 As New ListItem()
Dim subItem1 As New SubItem()
Dim subItem2 As New SubItem()
Dim listItem2 As New ListItem()
Dim subItem3 As New SubItem()
Dim subItem4 As New SubItem()
Dim listItem3 As New ListItem()
Dim subItem5 As New SubItem()
Dim subItem6 As New SubItem()
Dim listItem4 As New ListItem()
Dim subItem7 As New SubItem()
Dim subItem8 As New SubItem()
Dim listItem5 As New ListItem()
Dim subItem9 As New SubItem()
Dim subItem10 As New SubItem()
Dim listColumn1 As New ListColumn()
Dim listColumn2 As New ListColumn()
subItem1.Value = "AA"
subItem2.Value = "001"
listItem1.SubItems.AddRange(New SubItem() {subItem1, subItem2})
subItem3.Value = "BB"
subItem4.Value = "002"
listItem2.SubItems.AddRange(New SubItem() {subItem3, subItem4})
subItem5.Value = "CC"
subItem6.Value = "003"
listItem3.SubItems.AddRange(New SubItem() {subItem5, subItem6})
subItem7.Value = "AA"
subItem8.Value = "004"
listItem4.SubItems.AddRange(New SubItem() {subItem7, subItem8})
subItem9.Value = "DD"
subItem10.Value = "001"
listItem5.SubItems.AddRange(New SubItem() {subItem9, subItem10})
gcMaskedComboBox.Items.AddRange(New ListItem() {listItem1, listItem2, listItem3, listItem4, listItem5})
gcMaskedComboBox.ListColumns.AddRange(New ListColumn() {listColumn1, listColumn2})
End Sub
// Please use the following namespace
// using System.Windows.Forms;
// using GrapeCity.Win.Editors;
public void FindStringFromGcComboBox()
{
// Creates the GcMaskedComboBox.
GcMaskedComboBox gcMaskedComboBox1 = new GcMaskedComboBox();
// Creates items for the GcMaskedComboBox.
this.CreateItemsForFindString(gcMaskedComboBox1);
// The FindString can find out all the ListItem start with the "AA (Tel)" and following the format "[0] (Tel) [1]"
MatchedComboItemCollection collection = gcMaskedComboBox1.FindString("AA (Tel)", "[0] (Tel) [1]");
}
public void CreateItemsForFindString(GcMaskedComboBox gcMaskedComboBox)
{
ListItem listItem1 = new ListItem();
SubItem subItem1 = new SubItem();
SubItem subItem2 = new SubItem();
ListItem listItem2 = new ListItem();
SubItem subItem3 = new SubItem();
SubItem subItem4 = new SubItem();
ListItem listItem3 = new ListItem();
SubItem subItem5 = new SubItem();
SubItem subItem6 = new SubItem();
ListItem listItem4 = new ListItem();
SubItem subItem7 = new SubItem();
SubItem subItem8 = new SubItem();
ListItem listItem5 = new ListItem();
SubItem subItem9 = new SubItem();
SubItem subItem10 = new SubItem();
ListColumn listColumn1 = new ListColumn();
ListColumn listColumn2 = new ListColumn();
subItem1.Value = "AA";
subItem2.Value = "001";
listItem1.SubItems.AddRange(new SubItem[] {
subItem1,
subItem2});
subItem3.Value = "BB";
subItem4.Value = "002";
listItem2.SubItems.AddRange(new SubItem[] {
subItem3,
subItem4});
subItem5.Value = "CC";
subItem6.Value = "003";
listItem3.SubItems.AddRange(new SubItem[] {
subItem5,
subItem6});
subItem7.Value = "AA";
subItem8.Value = "004";
listItem4.SubItems.AddRange(new SubItem[] {
subItem7,
subItem8});
subItem9.Value = "DD";
subItem10.Value = "001";
listItem5.SubItems.AddRange(new SubItem[] {
subItem9,
subItem10});
gcMaskedComboBox.Items.AddRange(new ListItem[] {
listItem1,
listItem2,
listItem3,
listItem4,
listItem5});
gcMaskedComboBox.ListColumns.AddRange(new ListColumn[] { listColumn1, listColumn2 });
}