using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;namespace Allen
{
public partial class MyForm : Form
{
private Rectangle[] pointSquares; public MyForm()
{
InitializeComponent();
pointSquares = new Rectangle[255];
}
private void GetRecID(Point p)
{
//获取被选中的矩形块
for (int i = 0; i < 255; i++)
{
if (pointSquares.Contains(p))
{
return i;
}
}
}
.....上面的代码中,我定义了一个变量pointSquares是Rectangle的,Rectangle里面有个Contains方法的,我在msdn里面查过了,为什么vs会无法识别呢?而且还提示:错误 “System.Array”并不包含“Contains”的定义
这是为什么啊?
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;namespace Allen
{
public partial class MyForm : Form
{
private Rectangle[] pointSquares; public MyForm()
{
InitializeComponent();
pointSquares = new Rectangle[255];
}
private void GetRecID(Point p)
{
//获取被选中的矩形块
for (int i = 0; i < 255; i++)
{
if (pointSquares.Contains(p))
{
return i;
}
}
}
.....上面的代码中,我定义了一个变量pointSquares是Rectangle的,Rectangle里面有个Contains方法的,我在msdn里面查过了,为什么vs会无法识别呢?而且还提示:错误 “System.Array”并不包含“Contains”的定义
这是为什么啊?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货