【发布时间】:2012-08-20 04:22:06
【问题描述】:
我在 DataGrid 中有很多按钮
我想设置 根据我的 if 条件,按钮的颜色变为绿色,Button.Text 变为白色(并非全部,仅适用于 1 个按钮) 我已经使用 ITextSharp 来创建 PDF 生成,我评论了 iTextSharp 头文件,我得到了结果,但是这次我的代码中必须需要 iTextSharp 出现以下错误。
“无法将 iTextSharp.text.Color 类型隐式转换为 System.Drawing.Color”
这是我的 iTextSharp 头文件
using iTextSharp.text;
using iTextSharp.text.pdf;
using iTextSharp.text.html;
这是代码
if (dsRecAdj.Tables[2].Rows.Count > 0)
{
Button btn = (Button)e.Row.FindControl("btnSalvage");
btn.ForeColor = Color.Red;
}
请帮帮我
【问题讨论】:
-
你明白了,因为它们是不同的类型。如果值相同,则可以选择适合您的类型。
标签: c# background-color