背景が透明なパネルがあります。これらのいくつかをコントロールに追加すると、インデックスが最も高い子が一番上にレンダリングされます。誰かが何が起こっているのか、どうすればこれを解決できるのか教えてもらえますか?
これはパネルのコードです:
public ref class TransparentPanel : public Panel
{
public:
Bitmap^ _image;
TransparentPanel(Bitmap^ image){_image = image;Width = image->Width;Height = image->Height;}
virtual property System::Windows::Forms::CreateParams^ CreateParams{
System::Windows::Forms::CreateParams^ get(void) override {
System::Windows::Forms::CreateParams^ cp = Panel::CreateParams;
cp->ExStyle |= 0x00000020;//WS_EX_TRANSPARENT
return cp;
}
}
virtual void OnPaintBackground(PaintEventArgs^ e) override {}
virtual void OnPaint(PaintEventArgs^ e) override {e->Graphics->DrawImage(_image, Rectangle(0, 0, Width, Height));}
};