Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ cli 压倒一切;“文本”;属性派生自System::Windows::Forms::Control C++/CLI_C++ Cli_Controls_Overriding - Fatal编程技术网

C++ cli 压倒一切;“文本”;属性派生自System::Windows::Forms::Control C++/CLI

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

我试图重写我以前搜索过的基类中的“Text”属性,但它没有做任何更改,我仍然不知道如何正确地将代码放入头文件和CPP文件中

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 { /*...*/ }
    }
};