Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

same click event diffrenet buttonms c#

myButton1.Click += new MyButtonClick;
myButton2.Click += new MyButtonClick;
myButton3.Click += new MyButtonClick;
myButton4.Click += new MyButtonClick;
myButton5.Click += new MyButtonClick;
myButton6.Click += new MyButtonClick;

void MyButtonClick(object sender, EventArgs e)
{
    Button button = sender as Button;
    //here you can check which button was clicked by the sender
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# linq list select 
Csharp :: c# return tuple 
Csharp :: get ad user using email address microsoft graph C# 
Csharp :: c# goto statement 
Csharp :: c# write iformfile 
Csharp :: listbox items to string c# 
Csharp :: c# list add to list 
Csharp :: unity singleton 
Csharp :: c# unit test for throwing exception method 
Csharp :: unity ui button 
Csharp :: how to see if a number is even c# 
Csharp :: euler to quaternion 
Csharp :: c sharp list 
Csharp :: math with c sharp 
Csharp :: c# callback using delegate 
Csharp :: for statement syntax C sharp 
Csharp :: aspx element visibility ould not find 
Csharp :: select specific columns from datatable in c# using lambda 
Csharp :: C# one line method 
Csharp :: allow scroll with wheel mouse datagridview c# 
Csharp :: c# array of objects 
Csharp :: wpf change foreground c# 
Csharp :: c# internalsvisibleto 
Csharp :: how to fade c# form 
Csharp :: c# generic enum value to int 
Csharp :: wpf keydown detect if control key is down 
Csharp :: visual studio console.writeline not showing in output window 
Csharp :: how to use monitor from system.threading in c# 
Csharp :: linq contains 
Csharp :: console writeline 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =