This should do ..
public ref class DoubleBufferPanel : public Panel
{
public:
DoubleBufferPanel(void)
{
this->SetStyle(ControlStyles::DoubleBuffer
| ControlStyles::UserPaint
| ControlStyles::AllPaintingInWmPaint,
true);
this->SetStyle(ControlStyles::DoubleBuffer, true);
this->UpdateStyles();
}
};
mitrmkar
Posting Virtuoso
1,809 posts since Nov 2007
Reputation Points: 1,105
Solved Threads: 395
error C3379: 'Form1::Form2:: DoubleBufferPanel' : a nested class cannot have an assembly access specifier as part of its declaration
Move the DoubleBufferPanel class outside your Form class i.e.
#pragma once
namespace Form1 { // <- You might have another namespace here
// the usual 'using ...' stuff follows
using namespace System;
// etc ...
// Next your new class ...
public ref class DoubleBufferPanel : public Panel
{
public:
DoubleBufferPanel(void)
{
this->SetStyle(ControlStyles::DoubleBuffer
| ControlStyles::UserPaint
| ControlStyles::AllPaintingInWmPaint,
true);
this->SetStyle(ControlStyles::DoubleBuffer, true);
this->UpdateStyles();
}
};
// Followed by the original code ...
public ref class Form1 : public System::Windows::Forms::Form
...
mitrmkar
Posting Virtuoso
1,809 posts since Nov 2007
Reputation Points: 1,105
Solved Threads: 395