我正在寻找一种在Brushes集合(Aqua、Azure、...Black、...)中随机选择Brush的方法。有什么线索吗? 最佳答案 你可以使用一些反射,像这样:privateBrushPickBrush(){Brushresult=Brushes.Transparent;Randomrnd=newRandom();TypebrushesType=typeof(Brushes);PropertyInfo[]properties=brushesType.GetProperties();intrandom=rnd.Next(prop