Unfortunately there is no InputMessageBox in C#.
But you can reference “Microsoft.VisualBasic” and dann using the Interaction.InputBox.
using Microsoft.VisualBasic;
// Click-Event
private void btn_GetName_Click(object sender, EventArgs e)
{
string btnTxt = Interaction.InputBox("Title", "Message", "defaultValue", 10, 10);
Button button1 = new Button();
button1.Location = new Point(20, 10);
button1.Text = btnTxt;
this.Controls.Add(button1);
}
This is a really simple Task, please use next time Google or post some Code to debug your Errors.
BTW: There are many other solutions for this here in StackOverflow.
solved Windows form button displays textbox and enter name to create new button [closed]