HOW CAn I Differciate the button click Event

Posted by SHASHANK on Stack Overflow See other posts from Stack Overflow or by SHASHANK
Published on 2010-06-11T14:18:59Z Indexed on 2010/06/11 14:33 UTC
Read the original article Hit count: 366

Filed under:
|
|

hello All

i have a problem. i m making Some wpf button Dynamic through C#.i m using it A loop for this now i m trying to find all button Click Event. i find it But It Work Same on All The button Click how Can i Differciate all the button .

thanks in Advance shashank

`for (int i = 0; i < 2; i++)
        {
            Button b1 = new Button();
            //this.RegisterName("myAnimatedBrush", b1);
            b1.Name = "button" + i;     
            b1.Height = 200;
            b1.Width = 200;
            b1.Margin = new Thickness(0, -100, 0, 0);
            b1.HorizontalAlignment = HorizontalAlignment.Left;
            b1.Content = "English";
            b1.Background = System.Windows.Media.Brushes.Pink;
            b1.Click+=new RoutedEventHandler(b1_Click);
            canvasbtn.Children.Add(b1);
            Canvas.SetLeft(b1,b1.Width * i);

        }`

© Stack Overflow or respective owner

Related posts about c#

Related posts about wpf