Home > Net >  How to implement a BUTTON click on the BUTTON after change the text BUTTON
How to implement a BUTTON click on the BUTTON after change the text BUTTON

Time:04-16

How to implement a BUTTON BUTTON click the change BUTTON text point again after the change back again

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,
  •  Tags:  
  • C#
  • Related