【发布时间】:2014-06-04 03:33:31
【问题描述】:
我正在尝试访问数组中列出的颜色,但不知道如何访问,我在 google 上搜索但没有找到帮助内容。
protected void DropDownList7_SelectedIndexChanged(object sender, EventArgs e)
{
string[] color=new string[] {"Azure","BlanchedAlmond","Black","Beige","DarkGreen","DarkKhaki","DarkOrange"}
for(int i=0 ;i<color.Length;i++)
{
if(DropDownList7.SelectedIndex==i)
Label11.ForeColor=Color.?;
}
}
如何从颜色数组中获取颜色以使用它。
Label11.ForeColor=Color.?;
【问题讨论】:
-
如果您收到该错误说明您没有使用我的代码,请仔细检查我的代码。我使用的是
Color[] colors而不是string[] color,也不要编辑答案的错误,只需在它们下方评论