首页上一页 1 下一页尾页 1 条记录 1/1页
还是上次问题
发表在C#图书答疑
2009-04-27
是否精华
是
否
版块置顶:
是
否
if (C.GetType().Name == "TextBox" && C.Text != "")
{
sID = C.Name;
if (sID.IndexOf(TName) > -1)
{
string[] Astr = sID.Split(Convert.ToChar('_'));
string m_Sgin = "";
string mID = "";
if (Astr.Length > 2)
mID = Astr[1] + "_" + Astr[2];
else
mID = Astr[1];
foreach (Control C1 in GBox)
{
if (C1.GetType().Name == "ComboBox")
if ((C1.Name).IndexOf(mID) > -1)
{
if (C1.Text == "")
break;
else
{
m_Sgin = C1.Text;
break;
}
}
}
if (m_Sgin != "")
FindValue = FindValue + "(" + mID + m_Sgin + C.Text + ")+ANDSign;
}
想问: if (C1.GetType().Name == "ComboBox") 语句是在if (C.GetType().Name == "TextBox" && C.Text != "") 语句的花括号中,既然由前面的条件约束了控件名是为“textbox”,怎么又会是“combobox”呢?
{
sID = C.Name;
if (sID.IndexOf(TName) > -1)
{
string[] Astr = sID.Split(Convert.ToChar('_'));
string m_Sgin = "";
string mID = "";
if (Astr.Length > 2)
mID = Astr[1] + "_" + Astr[2];
else
mID = Astr[1];
foreach (Control C1 in GBox)
{
if (C1.GetType().Name == "ComboBox")
if ((C1.Name).IndexOf(mID) > -1)
{
if (C1.Text == "")
break;
else
{
m_Sgin = C1.Text;
break;
}
}
}
if (m_Sgin != "")
FindValue = FindValue + "(" + mID + m_Sgin + C.Text + ")+ANDSign;
}
想问: if (C1.GetType().Name == "ComboBox") 语句是在if (C.GetType().Name == "TextBox" && C.Text != "") 语句的花括号中,既然由前面的条件约束了控件名是为“textbox”,怎么又会是“combobox”呢?