C++ cli 压倒一切;“文本”;属性派生自System::Windows::Forms::Control C++/CLI
我试图重写我以前搜索过的基类中的“Text”属性,但它没有做任何更改,我仍然不知道如何正确地将代码放入头文件和CPP文件中C++ cli 压倒一切;“文本”;属性派生自System::Windows::Forms::Control C++/CLI,c++-cli,controls,overriding,C++ Cli,Controls,Overriding,我试图重写我以前搜索过的基类中的“Text”属性,但它没有做任何更改,我仍然不知道如何正确地将代码放入头文件和CPP文件中 public ref class MyCustomControl: public System::Windows::Forms::Control { [Overriding "Text" property goes here...] }; 这应该起作用: public ref class MyCustomControl: public System::Wi
public ref class MyCustomControl: public System::Windows::Forms::Control
{
[Overriding "Text" property goes here...]
};
这应该起作用:
public ref class MyCustomControl: public System::Windows::Forms::Control
{
virtual property System::String^ Text
{
System::String^ get() override { return L"Blahblah"; }
void set(System::String^ value) override { /*...*/ }
}
};