小编Act*_*ble的帖子

什么是Graphics.Clear(); 不在C#中工作

我正在为我的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)

.net c# system.drawing winforms

-2
推荐指数
1
解决办法
9589
查看次数

标签 统计

.net ×1

c# ×1

system.drawing ×1

winforms ×1