저는 C# 프로그래밍 초보자이며 Windowsform 응용 프로그램에서 사각형을 그립니다. 나는 마이크로 소프트 비주얼 스튜디오 2012를 사용하고이 예제 코드를 가지고 :C# fillrectangle MVS 2012
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void FillRectangleRectangle(PaintEventArgs e)
{
// Create solid brush.
SolidBrush blueBrush = new SolidBrush(Color.Blue);
// Create rectangle.
Rectangle rect = new Rectangle(0, 0, 200, 200);
// Fill rectangle to screen.
e.Graphics.FillRectangle(blueBrush, rect);
}
}
}
하지만이 나던 단어, 누군가가 나를 도울 수 있습니까?
그럼 'FillRectangleRectangle'을 * 호출하려고합니까? 정확히 "작동하지 않는다"는 것은 무엇을 의미합니까? 무슨 일이야? –
폼의 Paint 이벤트에서 함수를 호출 해보십시오. –