For a usercontrol TextBox i am creating properties like AutoCompleteCustomSource
, AutoCompleteMode
and AutoCompleteSource
:
public virtual AutoCompleteStringCollection AutoCompleteCustomSource
{
get { return txtLocl.AutoCompleteCustomSource; }
set { txtLocl.AutoCompleteCustomSource = value; }
}
public virtual AutoCompleteMode AutoCompleteMode
{
get { return txtLocl.AutoCompleteMode; }
set { txtLocl.AutoCompleteMode = value; }
}
public virtual AutoCompleteSource AutoCompleteSource
{
get { return txtLocl.AutoCompleteSource; }
set {txtLocl.AutoCompleteSource=value;}
}
I am creating like that but i am getting error like this for AutoCompleteCustomSource
string collection. i show you the error
and what i want is i show in the below figure
Please try this, I hope it will work:
public string[] AutoCompleteCustomSource
{
get
{
List<string> lStringList = new List<string>();
foreach (string lval in this.mEkaTextBox.AutoCompleteCustomSource)
{
lStringList.Add(lval);
}
return lStringList.ToArray();
}
set
{
txtLocl.AutoCompleteCustomSource.AddRange(value);
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.