只需要一个表单的圆角 [英] Simply round corners of a form

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

问题描述

我正在寻找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.

推荐答案

在表单上放置一个面板,然后使表格变为透明。你可以在面板上添加

控件。


OHM


Mike D写道:
Put a panel on the form and then make the form tranparent. You can add the
controls over the panel.

OHM

Mike D wrote:
我正在寻找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.



*" Mike D" <二**** @ hotmail.com> scripsit:
* "Mike D" <di****@hotmail.com> scripsit:
我正在寻找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>


忘掉我的帖子,它是未经测试的,根本就是不正确的。


对不起 - OHM

One Handed Man写道:
Forget my post, it was untested and simply incorrect.

Sorry - OHM
One Handed Man wrote:
在表格上放置一个面板然后使表格透明。你可以在面板上添加控件。

OHM
Mike D写道:
Put a panel on the form and then make the form tranparent. You can
add the controls over the panel.

OHM

Mike D wrote:
我在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.



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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆