我试图使按钮可见,然后单击按钮使按钮不可见,但是我是Windows编码的新手,所以任何帮助都将对您有所帮助。
#include "pch.h"
#include "MainPage.xaml.h"
#include <iostream>
using namespace App1;
using namespace Platform;
using namespace Windows::Foundation;
using namespace Windows::Foundation::Collections;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::UI::Xaml::Controls::Primitives;
using namespace Windows::UI::Xaml::Data;
using namespace Windows::UI::Xaml::Input;
using namespace Windows::UI::Xaml::Media;
using namespace Windows::UI::Xaml::Navigation;
// The Blank Page item template is documented at
https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
int blockbase = 1 ;
MainPage::MainPage()
{
InitializeComponent();
}
void App1::MainPage::Button_Click(Platform::Object^ sender,
Windows::UI::Xaml::RoutedEventArgs^ e)
{
greetingOutput->Text = "Hello, " + nameInput->Text + "! \n Welcome to the
worlds worst quiz show!!! \n Here is the one and only question: What
director directed the classic film Battleship Potempkin?";
AnswerChoiceA-> Visibility = "Visible" ;
}
当前我遇到错误C2664和E1767 C2664:'无效的Windows :: UI :: Xaml :: UIElement :: Visibility :: set(Windows :: UI :: Xaml :: Visibility)':无法将参数1从'const char [8]'转换为'Windows: :UI :: Xaml ::可见性'
E1767:函数“ Windows :: UI :: Xaml :: UIElement :: Visibility :: set”无法用给定的参数列表调用