TextBox
当从 a 中选择一个值时,如何只允许在 a 中输入一定数量的字符ComboBox
?c# 新手。
private void cbType_SelectionChanged(object sender, SelectionChangedEventArgs e)
try
{
conDataBase.Open();
myReader = cmdDataBase.ExecuteReader();
while (myReader.Read())
{
string sType = myReader.ToString();
if (sType == "Low")
{
int Value = 50;
}
else if (sType == "Medium")
{
int Value = 100;
}
else if (sType == "High")
{
int Value = 150;
}
txtDesc.MaxLength = (int)sType.Value;
}