So I am making a tool for PS3 however I need help on making a button do another action when clicked again, this is what I have but I am getting errors, thanks.
private void metroButton2_Click(object sender, EventArgs e)
{
byte[] On = new byte[] { 0x00 };
PS3.SetMemory(0x007EDCA4, On);
}
else
{
byte[] On = new byte[] { 0x65 };
PS3.SetMemory(0x007EDCA4, Off);
}
I see what you're trying to do but you can't use an else statement that way. The else keyword can only be used following an "if" statement. What you'll need is some kind of flag (a bool variable) which you switch between true and false to swap the button_click event's execution.
Alternatively, if you only want the button to do something the first time, and then do something different every other time, just remove one of the flag assignments. That way, when its set to false, it will never execute the first block of code again.