急!!我想画个线怎么显示不出来呢 Graphics g = this.CreateGraphics();g.DrawLine(System.Drawing.Pens.Red,0,0,100,100);我想画一个表格,要先画一条线,但是显示不出来大虾回答,谢谢:) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 egxsun() 把你的代码都贴出来,我看看 我的代码都贴出来了,在一楼啊。 我把代码放在 Page_Load中了啊 别放到Load里面放到Paint里面需要时还可以调用Refresh重绘 刷新一次呢~~~强行重绘窗体this.Refresh() C#] public void DrawLinePointF(PaintEventArgs e){// Create pen.Pen blackPen = new Pen(Color.Black, 3);// Create points that define line.PointF point1 = new PointF(100.0F, 100.0F);PointF point2 = new PointF(500.0F, 100.0F);// Draw line to screen.e.Graphics.DrawLine(blackPen, point1, point2);}我在用这个想画个表格,需要PaintEventArgs e,不知道调用时怎么获得这个参数,我要不到这个参数 你得用控件的Piant事件如:private void Form1_Paint(object sender,System.Windows.Forms.PaintEventArgs e){Pen blackPen = new Pen(Color.Black, 3);// Create points that define line.PointF point1 = new PointF(100.0F, 100.0F);PointF point2 = new PointF(500.0F, 100.0F);// Draw line to screen.e.Graphics.DrawLine(blackPen, point1, point2);} 到底是web还是桌面程序? 呵呵 解决了,要先声名Form1的Paint事件,然后再Paint事件函数中就好了谢谢大家关心:) repeater根据数据不同每行的样式不同.net winfrom 保存从数据库读取的数据? 一个获取文件个数的问题 ServiceController对象无法启动SQLEXPRESS服务 为什么listview只能返回一次数据,多了就返回不了,帮看看 如何实现用winform程序登陆网站后台获取想要的数据 Ftp服务器禁用PASV(被动模式),请教如何传送数据(使用Socket链接)???? 在WinForm中如何把菜单读入TreeView中? VS2008怎么翻看重载函数提示 Regex只能读text中的最后一个词,大侠帮忙看看啊~~ 编译的问题进来看看! 改C++代码为C#代码,谢谢!
public void DrawLinePointF(PaintEventArgs e)
{
// Create pen.
Pen blackPen = new Pen(Color.Black, 3);
// Create points that define line.
PointF point1 = new PointF(100.0F, 100.0F);
PointF point2 = new PointF(500.0F, 100.0F);
// Draw line to screen.
e.Graphics.DrawLine(blackPen, point1, point2);
}
我在用这个想画个表格,需要PaintEventArgs e,不知道调用时怎么获得这个参数,我要不到这个参数
private void Form1_Paint(object sender,System.Windows.Forms.PaintEventArgs e)
{
Pen blackPen = new Pen(Color.Black, 3);
// Create points that define line.
PointF point1 = new PointF(100.0F, 100.0F);
PointF point2 = new PointF(500.0F, 100.0F);
// Draw line to screen.
e.Graphics.DrawLine(blackPen, point1, point2);
}
谢谢大家关心:)