如何使Windows窗体可用?

时间:2014-08-24 00:37:32

标签: winforms c++-cli

当我启动应用程序时,它会加载表单,但当我将鼠标悬停在它上面时,鼠标光标将保持加载状态。不仅如此,菜单也没有显示。     // MyForm.cpp

MyForm::MyForm () 
{
    this->Size = System::Drawing::Size (300, 300);
    InitializeComponents ();
    this->Show ();
}


MyForm::~MyForm ()
{

}

void MyForm::InitializeComponents () 
{
    // Create componentes
    mainMenu = gcnew System::Windows::Forms::MainMenu ();
    fileMenuItem = gcnew System::Windows::Forms::MenuItem ();
    aboutMenuItem = gcnew System::Windows::Forms::MenuItem ();

    // Intizlize components
    fileMenuItem->Text = "File";
    aboutMenuItem->Text = "About";

    // Bind main menu to this form
    this->Menu = mainMenu;
}

// Main
MyForm ^myForm = gcnew MyForm ();
Console::ReadKey ();

0 个答案:

没有答案