1、给StactPanel在后台设定背景色 SolidColorBrush brush = new SolidColorBrush(Colors.Blue); stackPanelGroup.Background = brush;