如何为WPF页面赋予标题 [英] How to give title to WPF pages

查看:615
本文介绍了如何为WPF页面赋予标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何为WPF页面赋予标题

可以在设计时通过XAML代码本身为WPF窗口提供标题,并在运行时将其显示给窗口.

XAML中的代码就像
Window1.Title ="FormulaBuilder"

对于WPF页面,它也在XAML代码中给出,例如
Page1.Title ="EmployeeMaster"

但是它没有在运行时显示标题

然后我尝试给标题打上C#编码

Page1 obj = new Page1();
obj.Title ="EmployeeMaster";

但是它没有在运行时显示标题.



如何为WPF页面赋予标题....

如果有人回复,这对我将非常有帮助....

预先感谢...

How to give title to WPF pages

It is possible to give the title to WPF window through XAML code itself at design time and it is showing the title to window at runtime.

the code in the XAML is like
Window1.Title="FormulaBuilder"

For the WPF pages also it is given in the XAML code like
Page1.Title="EmployeeMaster"

But it is not showing the title at Runtime

Then I tried to give the title thrugh C# coding

Page1 obj=new Page1();
obj.Title="EmployeeMaster";

But it is not showing the title at runtime.



How to give the title to WPF pages....

It will be very helpful for me if anyone reply to this....

Advance thanks...

推荐答案

我怀疑您需要在页面窗口中设置标题.

I suspect you need to set the title on the window in the pages.

LukmanulHakeem.T写道:
LukmanulHakeem.T wrote:

Page1 obj = new Page1();
obj.Title ="EmployeeMaster";

Page1 obj=new Page1();
obj.Title="EmployeeMaster";



我假设您继续显示Page1的这个实例,但您并不是这么做是为了希望从随机的某个地方找到Page1?



I assume you went on to show this instance of Page1, that you didn''t do this in the hope of finding Page1 from somewhere random ?


这篇关于如何为WPF页面赋予标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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