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


VulpesRank #55 · 29.2K reputationPosted Aug 1, 2014, 7:34 AM EDT
Ramesh MaruthiRank #937 · 2.2K reputationPosted Aug 1, 2014, 7:54 AM EDT
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");
}
}
}
Farhan ShariffRank #2,004 · 725 reputationPosted Aug 1, 2014, 11:59 AM EDT
Farhan ShariffRank #2,004 · 725 reputationPosted Aug 1, 2014, 12:01 PM EDT
Farhan ShariffRank #2,004 · 725 reputationPosted Aug 1, 2014, 12:02 PM EDT
VulpesRank #55 · 29.2K reputationPosted Aug 1, 2014, 3:57 PM EDT