【发布时间】:2020-04-01 08:18:59
【问题描述】:
ContentControl contentControl = new ContentControl();
StackPanel stackPanel = new StackPanel();
stackPanel.Height = 50;
stackPanel.Width = 100;
//stackPanel.Background = new SolidColorBrush(Colors.Green);
contentControl.Background = new SolidColorBrush(Colors.Red);
contentControl.BorderBrush = new SolidColorBrush(Colors.BlanchedAlmond);
contentControl.BorderThickness = new Thickness(5);
contentControl.Content = stackPanel;
当我为 stackpanel 设置背景时,它可以工作,但它不适用于 contentcontrol.. 我需要内容控制背景。!!
【问题讨论】: