c#中GDI+的using问题
usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Da...
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 绘制线段
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
protected override void OnPaint(PaintEventArgs e)
{
Graphics g = e.Graphics;
using (Pen bluePen = new Pen(Color.Blue, 1))
{
if (ClientRectangle.Height / 10 > 0)
{
for (int y = 0; y < ClientRectangle.Height; y += ClientRectangle.Height / 10)
{
g.DrawLine(bluePen, new Point(0, 0), new Point(ClientRectangle.Width, y));
}
}
}
}
}
}
请问这里的using是什么语法,是什么知识点,我只知道using是用来使用命名空间的啊,这里的using那段时什么意思?多谢了,实在没分了! 展开
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace 绘制线段
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
protected override void OnPaint(PaintEventArgs e)
{
Graphics g = e.Graphics;
using (Pen bluePen = new Pen(Color.Blue, 1))
{
if (ClientRectangle.Height / 10 > 0)
{
for (int y = 0; y < ClientRectangle.Height; y += ClientRectangle.Height / 10)
{
g.DrawLine(bluePen, new Point(0, 0), new Point(ClientRectangle.Width, y));
}
}
}
}
}
}
请问这里的using是什么语法,是什么知识点,我只知道using是用来使用命名空间的啊,这里的using那段时什么意思?多谢了,实在没分了! 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询