現在、Windows フォーム アプリケーションを使用して Visual Studio でプログラムを作成していますが、ペイント イベントで図形や線を描画しようとするたびに、次のエラーが発生します。
C2228: '.DrawString' の左側にはクラス/構造体/共用体が必要です
以下は、ヘッダー ファイルからの痛みイベントを含む私のコードです。
using namespace System::Drawing;
void InitializeComponent(void)
{
this->Paint += gcnew System::Windows::Forms::PaintEventHandler(this, &Form1::Form1_Paint);
}
{
private: System::Void Form1_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e) {
e.Graphics.DrawRectangle(blackPen, x, y, width, height);
}
};
どんな助けでも大歓迎です