WPF 弹窗
2021-03-10 01:28
标签:效果 事件 cli dev out code class tcl info 效果: 主窗体打开弹窗ModifyTextDialog 窗体事件: MoveAndResizeControl 的 WPF 弹窗 标签:效果 事件 cli dev out code class tcl info 原文地址:https://www.cnblogs.com/Lulus/p/12717999.htmlprivate void ModifyTextClick(object sender, RoutedEventArgs e)
{
ModifyTextDialog dialog = new ModifyTextDialog(myTextBlock.Text);
var r= dialog.ShowDialog();
//得到弹窗返回结果,如果是true
if (r.HasValue && r.Value==true)
{
myTextBlock.Text = dialog.myTextBox.Text;
}
}
private void OkClick(object sender, RoutedEventArgs e)
{
//设置结果
this.DialogResult = true;
this.Close();
}
private void CancleClick(object sender, RoutedEventArgs e)
{
this.DialogResult = false;
this.Close();
}
示例代码
move and rezise TextBlock
文本框,右键“修改文字内容”