' Please use the following namespace
' Imports System.Windows.Forms;
' Imports GrapeCity.Win.Editors;
Public Sub FindObjectFromGcMaskedComboBox()
' Creates the GcMaskedComboBox
Dim gcMaskedComboBox1 As New GcMaskedComboBox()
' Creates items for the GcMaskedComboBox.
Me.CreateItems(gcMaskedComboBox1)
' The FindObject can find out all the SubItems with the "001" value.
Dim collection As MatchedComboItemCollection = gcMaskedComboBox1.FindObject("001", 1)
' This method can find out the first SubItem which has the "001" value.
Dim index As Integer = gcMaskedComboBox1.FindObject("001", -1, 1)
End Sub
Public Sub CreateItems(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 FindObjectFromGcComboBox()
{
// Creates the GcMaskedComboBox
GcMaskedComboBox gcMaskedComboBox1 = new GcMaskedComboBox();
// Creates items for the GcMaskedComboBox.
this.CreateItems(gcMaskedComboBox1);
// The FindObject can find out all the SubItems with the "001" value.
MatchedComboItemCollection collection = gcMaskedComboBox1.FindObject("001", 1);
// This method can find out the first SubItem which has the "001" value.
int index = gcMaskedComboBox1.FindObject("001", -1, 1);
}
public void CreateItems(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 });
}