C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
C# program that uses Text property
using System;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
// Form has a Text property.
this.Text = "The Dev Codes";
// TextBox has a Text property.
textBox1.Text = "Thanks";
}
}
}
Tip: The Text property can be assigned to a string variable reference, or a string literal.
StringString Literal