C#界面画虚线且无
private void labelbar11_Paint(object sender, PaintEventArgs e) { Pen pen1 = new Pen(Color.Black, 3); pen1.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash; pen1.DashPattern = new float[] { 4f, 2f }; e.Graphics.DrawRectangle(pen1, 0, 0, this.panel1.Width - 1, this.panel1.Height - 1); }