CodePudding user response:
Public _click ()
{
InitializeComponent ();
Bool press=false;
The Button Button=new Button ()
{
Location=new Point (10, 10),
Text="Press A",
};
Button. Click +=(s, e)=& gt;
{
Press=! Press;
Button. The Text=press==true? Press "B" : "Press A";
};
This. Controls. The Add (button);
}
CodePudding user response:
The simplest way is to determine the current button text, set the display of words,