can I add text box beside the title of WPF window

我的梦境 提交于 2020-01-05 08:57:27

问题


We have a requirement where need to change the title which I can't change the existing code. I can write my c# code using the existing namespaces, libraries something like extensibility of the existing application.

My question how Title can be changed from my code with my requirement(existing code already changed the title as per their requirement)

Please suggest any changes

Thanks, Rajesh


回答1:


for (int i = 0; i < Application.Current.Windows.Count; i++)
        {
            var win = Application.Current.Windows[i];
            if (win.Title == "MainWindow")
                win.Title = "LastWindow";
        }

I hope this will help you to give an idea.You can Apply this code anywhere in your View Project.



来源:https://stackoverflow.com/questions/14700270/can-i-add-text-box-beside-the-title-of-wpf-window

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!