请教关于c#的paint事件

[复制链接]
查看11 | 回复2 | 2006-9-6 21:14:23 | 显示全部楼层 |阅读模式
请各位帮忙!为何我用paint事件在窗体绘制曲线的时候 窗体怎么没有任何显示 请各位赐教!
回复

使用道具 举报

千问 | 2006-9-6 21:14:23 | 显示全部楼层
先说清楚你怎么做的。
回复

使用道具 举报

千问 | 2006-9-6 21:14:23 | 显示全部楼层
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Drawing.Drawing2D;
namespace 曲线
{

中间省略

/// 应用程序的主入口点。

///

[STAThread]

static void Main()

{

Application.Run(new Form1());

}



private voidForm1_Paint(object sender,

System.Windows.Forms.PaintEventArgs e)

{

LinearGradientBrush linGrBrush = new LinearGradientBrush(new Point(0,0),

new Point(200,100),

Color.FromArgb(255,0,255,0),Color.FromArgb(255,0,255,0));

Pen pen=new Pen(linGrBrush,10);

e.Graphics.DrawLine(pen,32,48,100,200);

e.Graphics.FillEllipse(linGrBrush,10,100,200,100);

}

}
}
我是仿照书上的一个开发实例写得,可是我的窗体上却没任何显示~~~
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行