1

現在、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);
     }
    };

どんな助けでも大歓迎です

4

1 に答える 1

1

変化する

e.Graphics.DrawRectangle( ...

e->Graphics->DrawRectangle( ...
于 2013-06-13T14:17:49.667 に答える