I have a small WinForms application with only a button at the Center of the main window. That's button text is Button 1. The constructor in code behind (F7) change thats button text to Hello World after the call to InitializeComponent.
The runtime Shows "Hello World" but at design time the Designer Shows "Button 1". What is the correct way in WinForms to run custom UI-code. If I manually put that code into the designer-file than my changes gets overridden next time when designer is saved.
Here is my code:
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.button1.Text = "Hello World";
}
}