Set Form window title and center the Form window on the desktop : Form Frame Window « GUI Windows Form « C# / C Sharp
- C# / C Sharp
- GUI Windows Form
- Form Frame Window
Set Form window title and center the Form window on the desktop

using System;
using System.Windows.Forms;
using System.Drawing;
public class TestForm2 {
static void Main() {
Form simpleForm = new Form();
simpleForm.Height = 200;
simpleForm.Width = 200;
simpleForm.Text = "This is the title";
// Center the Form on the desktop
simpleForm.StartPosition = FormStartPosition.CenterScreen;
simpleForm.Visible = true;
Application.Run(simpleForm);
}
}
Related examples in the same category