WPF 弹窗

2021-03-10 01:28

阅读:641

标签:效果   事件   cli   dev   out   code   class   tcl   info   

效果:
技术图片

主窗体打开弹窗ModifyTextDialog

private 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();
}

示例代码

MoveAndResizeControl 的move and rezise TextBlock文本框,右键“修改文字内容”

WPF 弹窗

标签:效果   事件   cli   dev   out   code   class   tcl   info   

原文地址:https://www.cnblogs.com/Lulus/p/12717999.html


评论


亲,登录后才可以留言!