【问题标题】:Changing the background of a WPF toolbar panel更改 WPF 工具栏面板的背景
【发布时间】:2008-12-23 15:41:24
【问题描述】:

我正在尝试在 C# 代码中重现具有两个渐变背景的 Visual Studio 样式工具栏。我可以看到如何在 XAML 中执行此操作,但是如何在我的 C# 代码中深入研究对象以更改其“MainPanelBorder”边框的背景?

谢谢

【问题讨论】:

    标签: c# wpf toolbar


    【解决方案1】:

    你需要使用

    myToolbar.Template.FindName("MainPanelBorder", myToolbar) as Panel 
       //Or whatever the type of the item is in the template.
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-03-31
      • 2010-11-19
      • 2016-04-21
      • 1970-01-01
      • 2010-12-15
      • 1970-01-01
      相关资源
      最近更新 更多