Can we write two events in one button?
Means, As a user I had filled one form and then I have click submit button. On that button I had written one event that:This whole form will go to the admin user. On that form admin user will select one item from drop-down which is hide for 1st user. Now,the admin user will click the submit button. And on that click event the form will be sent to the higher authority for approval.
My question is Admin is clicking the same button which clicked by 1st user. So, how can I differentiate the event in only one button.
That 1st time it will go to the admin and 2nd time it will go to the higher authority.


FroglegRank #1,020 · 1.9K reputationPosted Mar 9, 2011, 7:19 PM EST
bool firstClick = false;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (firstClick == false)
{
firstClick = true;
MessageBox.Show("First click");
}
else
{
firstClick = false;
MessageBox.Show("Second click");
}
}
}
Suthish NairRank #92 · 22.8K reputationPosted Mar 10, 2011, 8:55 AM EST
Sahil Jani196 reputationPosted Mar 10, 2011, 7:43 PM EST
My form is not depending upon the role base activity.
This form is accessed by all to fill-up. And I have only one button in that form on which I have to perform two activities one after the other.
So, is there any solution with you to do this thing?
Please help me regarding this.
Sahil Jani196 reputationPosted Mar 10, 2011, 8:00 PM EST
Thnks for giving me code. Actully, your code is working but my requirements is not being ful-filled.
Sam HobbsRank #107 · 20.5K reputationPosted Mar 10, 2011, 9:14 PM EST