Reputation: 445
I am really new to C# and visual studio
My situation here is I have 2 button where button1_click
(to do some processing) and button2_click
(to go to next process)
What i want to ask, is it possible to do something like, to set button2_click
can only be clicked only after the user click the button1_click
at first..
Thanks for your reply!
Upvotes: 2
Views: 779
Reputation: 29036
Yes it is possible, to do this you have to disable the Button2
initially and then enable that inside the Click event of Button1
; Something like the following:
private void Button1_Click(object sender, EventArgs e)
{
if("some condition if needed")
{
Button2.Enabled = true;
}
}
Make sure that Button2
is disabled initially or else include this Button2.Enabled = false;
in the page/form load
Upvotes: 5
Reputation: 5764
Set button2 enabled property to false. And in button1_click event handler set button2 enabled property to true.
Upvotes: 3