问题描述
你好!我正在Visual Studio中创建一个生成语言的应用程序,然后在屏幕上显示它。我想使用Windows窗体,但无法使其工作。我尝试了Form1.Text = x,这给了我一个错误,但对按钮的文本属性
做同样的事情却没有。在此先感谢您的帮助!
Howdy! I'm making an app in Visual Studio which generates language, then displays it onscreen. I want to use a windows form, but can't get it to work. I tried Form1.Text = x, which gives me an error, but doing the same thing for a button's text property doesn't. Thanks in advance for any help!
使用System.Collections.Generic;
使用System.ComponentModel;
使用System.Data;
使用System.Drawing;
使用System.Linq;
使用System.Text ;
使用System.Threading.Tasks;
使用System.Windows.Forms;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
推荐答案
如果这是错误行 Pomescreen.Text = test;然后将其更改为
If this is the error line Pomescreen.Text = test; then change it to
var form = new Pomescreen();
var form = new Pomescreen();
form.Text = test;
form.Text = test;
目前你可以这样做,所以你需要按如下方式移动它
Currently you can simply do that so you need to move it as follows
if (!formload)
{
var form = new Pomescreen();
form.Text = test;
form.Show();
formload = true;
}
这篇关于如何在Windows窗体上显示文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!