除了在窗体和已有控件上面绘图外,也可以在自定义控件上绘图,完成个性化设计,现以设计一个交通灯控件为例:
public partial class TrafficLightCtrl :UserControl
{
struct Light
{
int left, top, width, height;
public Color FillColor;
public void Move(int left,int top,int width,intheight)
{
this.left = left;
this.width = width;
this.top = top;
this.height = height;
}
//画图
public void Paint(Graphics g)
{
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。