using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;namespace 网络五子棋2
{
public partial class Form1 : Form
{
private Graphics draw;
private PictureBox pb;
public Form1()
{ InitializeComponent();
//start();
} private void start()
{ draw = pb.CreateGraphics();
Pen mypen = new Pen(Color.Red, 3);
Rectangle rect = new Rectangle(50, 70, 256, 256);
draw.DrawRectangle(mypen, rect);
for (int i = 1; i <= 15; i++)
{
draw.DrawLine(mypen, 50 + 16 * i, 70, 50 + 16 * i, 326);
draw.DrawLine(mypen, 50, 16 * i + 70, 306, 16 * i + 70);
} }
}
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;namespace 网络五子棋2
{
public partial class Form1 : Form
{
private Graphics draw;
private PictureBox pb;
public Form1()
{ InitializeComponent();
//start();
} private void start()
{ draw = pb.CreateGraphics();
Pen mypen = new Pen(Color.Red, 3);
Rectangle rect = new Rectangle(50, 70, 256, 256);
draw.DrawRectangle(mypen, rect);
for (int i = 1; i <= 15; i++)
{
draw.DrawLine(mypen, 50 + 16 * i, 70, 50 + 16 * i, 326);
draw.DrawLine(mypen, 50, 16 * i + 70, 306, 16 * i + 70);
} }
}
解决方案 »
- 安装discuz2.6 sql版时,对 config 目录没有写入和删除权限!
- 一道面试题 关于类型转换
- 各位大虾,请问如何在C#中调用API函数
- 问题描述:子窗体调用主窗体的事件?
- 高手请进!验证哥德巴赫猜想
- 浮动气球提示的效果怎样实现?
- 一个关于窗体的初级问题(C#WINFORM)
- kill process出错!!
- 菜鸟求助,问个菜鸟问题。请路过的高手告诉一下。
- 在Server和Client间传送struct,用到序列化和反序列化,但在Client端出现找不到文件或程序集名称"Server".
- ASP.net GridView 如何加入 ToolTip
- Microsoft Visual Studio 里头怎么清除tapage里头数据
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
}
{ InitializeComponent();
}
我想在这里引用,求指导
{
InitializeComponent();
}
我想在这里引用,求指导
{
InitializeComponent();
this. this.Paint += new PaintEventHandler(Form1_Paint);
}
{ draw = pb.CreateGraphics();
改为:draw=this.creategraphics();