110,561
社区成员
发帖
与我相关
我的任务
分享
public string _strCode;
Rect tr;
public Form1()
{
InitializeComponent();
tr = new Rect(10, 10, 100, 40, this.Font)
{
Name = "rect1",
Visible = true,
};
//要处理的文本内容
_strCode = "if(rect1.Visible==true) Text='显示了'; else Text='隐藏了'";
//暂时将tr.Text="还没有处理"
tr.Text = "还没有处理";
this.Paint += delegate(object sender, PaintEventArgs e)
{
tr.Draw(e.Graphics);
};
using(Graphics g = this.CreateGraphics())
{
tr.Draw(g);
};
}