更新矩形列表

Updating a rectangle list

我正在使用 graphics.DrawRectangle 以 windows 形式绘制多个矩形,并将每个矩形添加到一个矩形中 list.later 正在编辑这些 rectangles.my 的位置和大小疑问是我是否可以在矩形列表中编辑矩形的值?

你可以这样做:

Rectangle temp = RectList[0];
temp.Width = 100;
temp.Height = 100;
temp.X = 0;
temp.Y=0;
RectList[0] = temp;