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;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace RactangleDrawAndMatrix
{
public partial class Form1 : Form
{
float move = 50f;
{
public partial class Form1 : Form
{
float move = 50f;
public Form1()
{
InitializeComponent();
{
InitializeComponent();
}
private void panel1_Paint(object sender, PaintEventArgs e)
{//这里画图是随着控件的刷新而刷新的,就是说只要控件不消失图就不消失。下面的则可能消失
Graphics g = panel1.CreateGraphics();
g.DrawRectangle(new Pen(Color.Black, 5), new Rectangle(50, 50, panel1.Width - 100, panel1.Height - 100));
}
private void panel1_Paint(object sender, PaintEventArgs e)
{//这里画图是随着控件的刷新而刷新的,就是说只要控件不消失图就不消失。下面的则可能消失
Graphics g = panel1.CreateGraphics();
g.DrawRectangle(new Pen(Color.Black, 5), new Rectangle(50, 50, panel1.Width - 100, panel1.Height - 100));
}