草庐IT

VisualStyleRenderer

全部标签

c# - 使用 VisualStyles 的控件边框颜色

Microsoft的winforms视觉样式一直让我感到困惑。我试图让Panel位于TreeView旁边,并且只有相同的VisualStyle边框。如您所见,TreeView边框与我在Panel中的绘图尝试不同。面板的BorderStyle设置为None。我已经试过了:Rectangler=newRectangle(0,0,panel1.ClientRectangle.Width-1,panel1.ClientRectangle.Height-1);using(Penp=newPen(VisualStyleInformation.TextControlBorder))e.Graphic