フォームのピクチャ ボックスに WndProc 関数を使用するにはどうすればよいですか? 私はこのコードのように試してみましたが、機能せず、パブリックにメッセージが送信されません: virtual void WndProc( Message% m )
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
namespace MyProject {
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void) {
InitializeComponent();
//TODO: Add the constructor code here
}
protected:
~Form1() {
if (components)
delete components;
}
private:
System::Windows::Forms::PictureBox^ pictureBox1;
System::ComponentModel::Container ^components;
void InitializeComponent(void) {
this->pictureBox1 = gcnew System::Windows::Forms::PictureBox();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^>(
this->pictureBox1))->BeginInit();
this->SuspendLayout();
//
// pictureBox1
//
this->pictureBox1->Location = System::Drawing::Point(41, 27);
this->pictureBox1->Name = L"pictureBox1";
this->pictureBox1->Size = System::Drawing::Size(206, 203);
this->pictureBox1->TabIndex = 0;
this->pictureBox1->TabStop = false;
//
// Form1
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(292, 265);
this->Controls->Add(this->pictureBox1);
this->Name = L"Form1";
this->Text = L"Form1";
(cli::safe_cast<System::ComponentModel::ISupportInitialize^>(
this->pictureBox1))->EndInit();
this->ResumeLayout(false);
}
};
ref class pictureBox1 : PictureBox {
public:
virtual void WndProc( Message% m ) override {
__super::WndProc(m);
}
};
}//close NameSpace