Olá, estou desenvolvendo um software de Bingo para a Igreja a qual eu frequento.
Ao apertar um botão de algum número qualquer, o mesmo irá aparecer no Picture Box ao lado. Como mostra a imagem seguinte.
Agora, percebam que existe o botão "<< Voltar", é nele que que preciso de ajuda. Preciso de um código para programá-lo para desfazer uma ação anterior. Por exemplo: Apertei o botão 42 na tela, mas não era para ser ele, era para ser o 43, como disse: uma vez apertado ele fica inutilizado. O usuário apertaria o botão "<< Voltar" para desfazer a ação dele - que era habilitar novamente o botão "42". Como faço isso? Desde já, agradeço.
@Edit A pedidos, meu código está assim:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Image btn1 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\1.jpg");
img_box.Image = btn1;
button1.Enabled = false;
}
private void button2_Click(object sender, EventArgs e)
{
Image btn2 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\2.jpg");
img_box.Image = btn2;
button2.Enabled = false;
}
private void button3_Click_1(object sender, EventArgs e)
{
Image btn3 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\3.jpg");
img_box.Image = btn3;
button3.Enabled = false;
}
private void button4_Click(object sender, EventArgs e)
{
Image btn4 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\4.jpg");
img_box.Image = btn4;
button4.Enabled = false;
}
private void button5_Click(object sender, EventArgs e)
{
Image btn5 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\5.jpg");
img_box.Image = btn5;
button5.Enabled = false;
}
private void button6_Click(object sender, EventArgs e)
{
Image btn6 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\6.jpg");
img_box.Image = btn6;
button6.Enabled = false;
}
private void button7_Click(object sender, EventArgs e)
{
Image btn7 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\7.jpg");
img_box.Image = btn7;
button7.Enabled = false;
}
private void button8_Click(object sender, EventArgs e)
{
Image btn8 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\8.jpg");
img_box.Image = btn8;
button8.Enabled = false;
}
private void button9_Click(object sender, EventArgs e)
{
Image btn9 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\9.jpg");
img_box.Image = btn9;
button9.Enabled = false;
}
private void button10_Click(object sender, EventArgs e)
{
Image btn10 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\10.jpg");
img_box.Image = btn10;
button10.Enabled = false;
}
private void button11_Click(object sender, EventArgs e)
{
Image btn11 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\11.jpg");
img_box.Image = btn11;
button11.Enabled = false;
}
private void button12_Click(object sender, EventArgs e)
{
Image btn12 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\12.jpg");
img_box.Image = btn12;
button12.Enabled = false;
}
private void button13_Click(object sender, EventArgs e)
{
Image btn13 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\13.jpg");
img_box.Image = btn13;
button13.Enabled = false;
}
private void button14_Click(object sender, EventArgs e)
{
Image btn14 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\14.jpg");
img_box.Image = btn14;
button14.Enabled = false;
}
private void button15_Click(object sender, EventArgs e)
{
Image btn15 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\15.jpg");
img_box.Image = btn15;
button15.Enabled = false;
}
private void button16_Click(object sender, EventArgs e)
{
Image btn16 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\16.jpg");
img_box.Image = btn16;
button16.Enabled = false;
}
private void button17_Click(object sender, EventArgs e)
{
Image btn17 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\17.jpg");
img_box.Image = btn17;
button17.Enabled = false;
}
private void button18_Click(object sender, EventArgs e)
{
Image btn18 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\18.jpg");
img_box.Image = btn18;
button18.Enabled = false;
}
private void button19_Click(object sender, EventArgs e)
{
Image btn19 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\19.jpg");
img_box.Image = btn19;
button19.Enabled = false;
}
private void button20_Click(object sender, EventArgs e)
{
Image btn20 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\20.jpg");
img_box.Image = btn20;
button20.Enabled = false;
}
private void button21_Click(object sender, EventArgs e)
{
Image btn21 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\21.jpg");
img_box.Image = btn21;
button21.Enabled = false;
}
private void button22_Click(object sender, EventArgs e)
{
Image btn22 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\22.jpg");
img_box.Image = btn22;
button22.Enabled = false;
}
private void button23_Click(object sender, EventArgs e)
{
Image btn23 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\23.jpg");
img_box.Image = btn23;
button23.Enabled = false;
}
private void button24_Click(object sender, EventArgs e)
{
Image btn24 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\24.jpg");
img_box.Image = btn24;
button24.Enabled = false;
}
private void button25_Click(object sender, EventArgs e)
{
Image btn25 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\25.jpg");
img_box.Image = btn25;
button25.Enabled = false;
}
private void button26_Click(object sender, EventArgs e)
{
Image btn26 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\26.jpg");
img_box.Image = btn26;
button26.Enabled = false;
}
private void button27_Click(object sender, EventArgs e)
{
Image btn27 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\27.jpg");
img_box.Image = btn27;
button27.Enabled = false;
}
private void button28_Click(object sender, EventArgs e)
{
Image btn28 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\28.jpg");
img_box.Image = btn28;
button28.Enabled = false;
}
private void button29_Click(object sender, EventArgs e)
{
Image btn29 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\29.jpg");
img_box.Image = btn29;
button29.Enabled = false;
}
private void button30_Click(object sender, EventArgs e)
{
Image btn30 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\30.jpg");
img_box.Image = btn30;
button30.Enabled = false;
}
private void button31_Click(object sender, EventArgs e)
{
Image btn31 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\31.jpg");
img_box.Image = btn31;
button31.Enabled = false;
}
private void button32_Click(object sender, EventArgs e)
{
Image btn32 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\32.jpg");
img_box.Image = btn32;
button32.Enabled = false;
}
private void button33_Click(object sender, EventArgs e)
{
Image btn33 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\33.jpg");
img_box.Image = btn33;
button33.Enabled = false;
}
private void button34_Click(object sender, EventArgs e)
{
Image btn34 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\34.jpg");
img_box.Image = btn34;
button34.Enabled = false;
}
private void button35_Click(object sender, EventArgs e)
{
Image btn35 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\35.jpg");
img_box.Image = btn35;
button35.Enabled = false;
}
private void button36_Click(object sender, EventArgs e)
{
Image btn36 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\36.jpg");
img_box.Image = btn36;
button36.Enabled = false;
}
private void button37_Click(object sender, EventArgs e)
{
Image btn37 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\37.jpg");
img_box.Image = btn37;
button37.Enabled = false;
}
private void button38_Click(object sender, EventArgs e)
{
Image btn38 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\38.jpg");
img_box.Image = btn38;
button38.Enabled = false;
}
private void button39_Click(object sender, EventArgs e)
{
Image btn39 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\39.jpg");
img_box.Image = btn39;
button39.Enabled = false;
}
private void button40_Click(object sender, EventArgs e)
{
Image btn40 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\40.jpg");
img_box.Image = btn40;
button40.Enabled = false;
}
private void button41_Click(object sender, EventArgs e)
{
Image btn41 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\41.jpg");
img_box.Image = btn41;
button41.Enabled = false;
}
private void button42_Click(object sender, EventArgs e)
{
Image btn42 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\42.jpg");
img_box.Image = btn42;
button42.Enabled = false;
}
private void button43_Click(object sender, EventArgs e)
{
Image btn43 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\43.jpg");
img_box.Image = btn43;
button43.Enabled = false;
}
private void button44_Click(object sender, EventArgs e)
{
Image btn44 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\44.jpg");
img_box.Image = btn44;
button44.Enabled = false;
}
private void button45_Click(object sender, EventArgs e)
{
Image btn45 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\45.jpg");
img_box.Image = btn45;
button45.Enabled = false;
}
private void button46_Click(object sender, EventArgs e)
{
Image btn46 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\46.jpg");
img_box.Image = btn46;
button46.Enabled = false;
}
private void button47_Click(object sender, EventArgs e)
{
Image btn47 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\47.jpg");
img_box.Image = btn47;
button47.Enabled = false;
}
private void button48_Click(object sender, EventArgs e)
{
Image btn48 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\48.jpg");
img_box.Image = btn48;
button48.Enabled = false;
}
private void button49_Click(object sender, EventArgs e)
{
Image btn49 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\49.jpg");
img_box.Image = btn49;
button49.Enabled = false;
}
private void button50_Click(object sender, EventArgs e)
{
Image btn50 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\50.jpg");
img_box.Image = btn50;
button50.Enabled = false;
}
private void button51_Click(object sender, EventArgs e)
{
Image btn51 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\51.jpg");
img_box.Image = btn51;
button51.Enabled = false;
}
private void button52_Click(object sender, EventArgs e)
{
Image btn52 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\52.jpg");
img_box.Image = btn52;
button52.Enabled = false;
}
private void button53_Click(object sender, EventArgs e)
{
Image btn53 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\53.jpg");
img_box.Image = btn53;
button53.Enabled = false;
}
private void button54_Click(object sender, EventArgs e)
{
Image btn54 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\54.jpg");
img_box.Image = btn54;
button54.Enabled = false;
}
private void button55_Click(object sender, EventArgs e)
{
Image btn55 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\55.jpg");
img_box.Image = btn55;
button55.Enabled = false;
}
private void button56_Click(object sender, EventArgs e)
{
Image btn56 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\56.jpg");
img_box.Image = btn56;
button56.Enabled = false;
}
private void button57_Click(object sender, EventArgs e)
{
Image btn57 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\57.jpg");
img_box.Image = btn57;
button57.Enabled = false;
}
private void button58_Click(object sender, EventArgs e)
{
Image btn58 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\58.jpg");
img_box.Image = btn58;
button58.Enabled = false;
}
private void button59_Click(object sender, EventArgs e)
{
Image btn59 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\59.jpg");
img_box.Image = btn59;
button59.Enabled = false;
}
private void button60_Click(object sender, EventArgs e)
{
Image btn60 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\60.jpg");
img_box.Image = btn60;
button60.Enabled = false;
}
private void button61_Click(object sender, EventArgs e)
{
Image btn61 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\61.jpg");
img_box.Image = btn61;
button61.Enabled = false;
}
private void button62_Click(object sender, EventArgs e)
{
Image btn62 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\62.jpg");
img_box.Image = btn62;
button62.Enabled = false;
}
private void button63_Click(object sender, EventArgs e)
{
Image btn63 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\63.jpg");
img_box.Image = btn63;
button63.Enabled = false;
}
private void button64_Click(object sender, EventArgs e)
{
Image btn64 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\64.jpg");
img_box.Image = btn64;
button64.Enabled = false;
}
private void button65_Click(object sender, EventArgs e)
{
Image btn65 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\65.jpg");
img_box.Image = btn65;
button65.Enabled = false;
}
private void button66_Click(object sender, EventArgs e)
{
Image btn66 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\66.jpg");
img_box.Image = btn66;
button66.Enabled = false;
}
private void button67_Click(object sender, EventArgs e)
{
Image btn67 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\67.jpg");
img_box.Image = btn67;
button67.Enabled = false;
}
private void button68_Click(object sender, EventArgs e)
{
Image btn68 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\68.jpg");
img_box.Image = btn68;
button68.Enabled = false;
}
private void button69_Click(object sender, EventArgs e)
{
Image btn69 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\69.jpg");
img_box.Image = btn69;
button69.Enabled = false;
}
private void button70_Click(object sender, EventArgs e)
{
Image btn70 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\70.jpg");
img_box.Image = btn70;
button70.Enabled = false;
}
private void button71_Click(object sender, EventArgs e)
{
Image btn71 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\71.jpg");
img_box.Image = btn71;
button71.Enabled = false;
}
private void button72_Click(object sender, EventArgs e)
{
Image btn72 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\72.jpg");
img_box.Image = btn72;
button72.Enabled = false;
}
private void button73_Click(object sender, EventArgs e)
{
Image btn73 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\73.jpg");
img_box.Image = btn73;
button73.Enabled = false;
}
private void button74_Click(object sender, EventArgs e)
{
Image btn74 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\74.jpg");
img_box.Image = btn74;
button74.Enabled = false;
}
private void button75_Click(object sender, EventArgs e)
{
Image btn75 = Image.FromFile(@"C:\Users\Dudu\Desktop\Softwares\Bingo 2.0\Img\75.jpg");
img_box.Image = btn75;
button75.Enabled = false;
}
}
}