c# js popup_c#一个popup问题 :Button_Click_send中如何取得textbox1的内容啊

为了能够获得,我把TextBoxtextbox1=newTextBox()做成全局变量的话,依次点击error_Click,Button_Click_send是能够获得的,但是再次点击error_Click就会出错,怎么办啊、、、、、、、...

为了能够获得,我把 TextBox textbox1 = new TextBox()做成全局变量的话,依次点击 error_Click,Button_Click_send是能够获得的,但是再次点击error_Click就会出错,怎么办啊

、、、、、、、、、、、、、、、、、、、、、、、

TextBox textbox1 = new TextBox();

private void error_Click(object sender, EventArgs e)

{

Popup p = new Popup();

Border border = new Border();

border.BorderBrush = new SolidColorBrush(Colors.LightGray);

StackPanel panel1 = new StackPanel();

panel1.Background = new SolidColorBrush(Colors.LightGray);

BuButton button2 = new Button();

button2.Content = "Send";

button2.Click += new RoutedEventHandler(Button_Click_send);

textbox1.Margin = new Thickness(5.0);

textbox1.Height = 350;

textbox1.Width = 370;

panel1.Children.Add(textbox1);

panel1.Children.Add(button2);

border.Child = panel1;

p.Child = border;

p.VerticalOffset = 50;

p.HorizontalOffset = 50;

p.IsOpen = true;

}

private void Button_Click_send(object sender, RoutedEventArgs e)

{

EmailComposeTask email = new EmailComposeTask();

email.To = "";

email.Subject = "";

email.Body = textbox1.Text ;

email.Show();

}

展开

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值