如何在wpf窗口中以编程方式更改标题? [英] How do I programmatically change the Title in a wpf window?

查看:82
本文介绍了如何在wpf窗口中以编程方式更改标题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在wpf窗口中以编程方式更改标题?

How do I programmatically change the Title in a wpf window?

<Window x:Class="Temp.MainWindow"
 ...
 Title="Contacts">

在程序启动时发现新信息时,将标题从联系人更改为新事物

Change the Title from "Contacts" to "Something new" when the program finds new information as it starts.

推荐答案

要更改它,您只需更改代码中的Title属性:

To change it you can simply alter the Title property from your code:

this.Title = "Something new";

这篇关于如何在wpf窗口中以编程方式更改标题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆