我正在为我的comp103文件做一些修改,我无法使用Graphics.Clear()获取按钮; 清除图形纸的方法.有人可以指出我的代码中的错误,因为我花了大约一个小时试图在网上找到答案.
很抱歉问这样一个菜鸟问题.
这是代码:
namespace Week_4_Ex1
{
public partial class Form1 : Form
{
const int height1 = 150; // A constant that stores the flags height
const int width1 = 100; // A constant that stores the flags width
public Form1()
{
InitializeComponent();
}
/// <summary>
/// Button event that Draws a flag
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnDraw_Click(object sender, EventArgs e)
{
Graphics Paper = this.CreateGraphics(); // Creates graphics paper to draw on …Run Code Online (Sandbox Code Playgroud)