请问如何动态修改Form1 的Text属性,我在Form1 中无法找到Text属性。有些人说用thsi.Text就能实现。从程序来看: public partial class Form1 : Form,这里的Form1继承自Form,Form1和Form一样都属于类,而不是一个实例,所以我能理解直接使用Form1 .Text是不行的,是否thsi.Text就表示实例化了Form1呢?是否和Form Form1=new Form();等效呢?也没见程序中哪里进行了实例化,请问如果我不使用thsi.Text这样的方式,我要自行实例化Form1,应该在哪里写代码?
using System;
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;
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
//Form1.Text = "窗口标题被改动";
this.Text = "窗口标题被改动";
}
}
}