本文介绍了只需要一个表单的圆角的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找vb.net中的一种方式来拍摄一个有尖角的表格,而且只需要稍微改善角落,因此它们不是那么尖锐。


我在其他应用程序中看到过这种情况。

I am looking for a way in vb.net to take a form with sharp corners and just
round off the corners a bit so they arent so sharp.

I have seen this done in other applications.

推荐答案






又快又脏:


\\\

Me.FormBorderStyle = FormBorderStyle.None

Me.Height = 300

Me.Width = 400

Dim p作为新Drawing2D.GraphicsPath()

p.StartFigure()

p.AddArc(新矩形(0,0,40,40),180,90)

p.AddLine(40,0,Me.Width - 40,0)

p.AddArc(新矩形(Me.Width - 40,0,40,40) ,-90,90)

p.AddLine(Me.Width,40,Me.Width,Me.Height - 40)

p.AddArc(New Rectangle(Me) .Width - 40,Me.Height - 40,40,40),0,90)

p.AddLine(Me.Width - 40,Me.Height,40,Me.Height)

p.AddArc(新矩形(0,Me.Height - 40,40,40),90,90)

p.CloseFigure()

Me.Region =新区(p)

Me.BackColor = Color.Red

///


-

Herfried K. Wagner [MVP]

< http://www.mvps.org/dotnet>



Quick and dirty:

\\\
Me.FormBorderStyle = FormBorderStyle.None
Me.Height = 300
Me.Width = 400
Dim p As New Drawing2D.GraphicsPath()
p.StartFigure()
p.AddArc(New Rectangle(0, 0, 40, 40), 180, 90)
p.AddLine(40, 0, Me.Width - 40, 0)
p.AddArc(New Rectangle(Me.Width - 40, 0, 40, 40), -90, 90)
p.AddLine(Me.Width, 40, Me.Width, Me.Height - 40)
p.AddArc(New Rectangle(Me.Width - 40, Me.Height - 40, 40, 40), 0, 90)
p.AddLine(Me.Width - 40, Me.Height, 40, Me.Height)
p.AddArc(New Rectangle(0, Me.Height - 40, 40, 40), 90, 90)
p.CloseFigure()
Me.Region = New Region(p)
Me.BackColor = Color.Red
///

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>




这篇关于只需要一个表单的圆角的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 01:05