在
Windows Phone应用程序中,我想动态添加一个按钮,如下所示:
Button btn = new Button(); btn.Content = tb_groupname.Text; btn.Width = 200; btn.Height = 200; btn.Click += new EventHandler(btn_Click);//Click event
Cannot implicitly convert type 'System.EventHandler' to 'System.Windows.RoutedEventHandler'
以下是按钮的click事件方法:
private void btn_Click(object sender,EventArgs e) { textBox1.text = "ABC"; // For Example }