I have a windows form which has :
1. Browse button(button1,button2,button3)
2.Check button
3.Start button
Once Start button is pressed I don't want other buttons(1 and 2 ) to work (if user click on it once start is pressed he should get a message that program is already running )at the same time I don't want the buttons to grey out (button.Enabled =false will grey out the button) I want to disable button action and not the button
Loading

VulpesPosted Aug 1, 2014, 11:34 AM
VulpesPosted Aug 1, 2014, 7:57 PM
Farhan ShariffPosted Aug 1, 2014, 4:02 PM
Farhan ShariffPosted Aug 1, 2014, 4:01 PM
Farhan ShariffPosted Aug 1, 2014, 3:59 PM
Ramesh MaruthiPosted Aug 1, 2014, 11:54 AM
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ButtonDISABLE
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button3_Click(object sender, EventArgs e)
{
MessageBox.Show("Process is started");
button1.Click -= button1_Click;
button2.Click -= button2_Click;
//((Button)sender).Click -= button2_Click;
}
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show("Am not running");
}
private void button2_Click(object sender, EventArgs e)
{
MessageBox.Show("Am not running");
}
}
}