Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/295.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在Windows WPF应用程序中,如何使用代码设置窗口标题_C#_Visual Studio - Fatal编程技术网

C# 在Windows WPF应用程序中,如何使用代码设置窗口标题

C# 在Windows WPF应用程序中,如何使用代码设置窗口标题,c#,visual-studio,C#,Visual Studio,在Visual Studio C#WPF应用程序中,我希望能够使用代码设置窗口标题,因为我希望能够更改代码中的版本号。公共部分类主窗口:窗口 { }例如 xaml 您可以使用以下方法进行更改: cs this.Title=“您的标题” 在主窗口中,您可以通过 this.Title = "New Title"; this.Title = "New Title";

在Visual Studio C#WPF应用程序中,我希望能够使用代码设置窗口标题,因为我希望能够更改代码中的版本号。

公共部分类主窗口:窗口 {

}

例如

xaml

您可以使用以下方法进行更改:

cs
this.Title=“您的标题”

在主窗口中,您可以通过

    this.Title = "New Title";
    this.Title = "New Title";