如下所示:
站在用戶的角度思考問題,與客戶深入溝通,找到舞陽網(wǎng)站設(shè)計與舞陽網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗,讓設(shè)計與互聯(lián)網(wǎng)技術(shù)結(jié)合,創(chuàng)造個性化、用戶體驗好的作品,建站類型包括:網(wǎng)站設(shè)計制作、網(wǎng)站制作、企業(yè)官網(wǎng)、英文網(wǎng)站、手機端網(wǎng)站、網(wǎng)站推廣、申請域名、網(wǎng)絡(luò)空間、企業(yè)郵箱。業(yè)務(wù)覆蓋舞陽地區(qū)。
Private?Sub?Type(ByVal?sender?As?Control,?ByVal?p_1?As?Integer,?ByVal?p_2?As?Double)
Dim?oPath?As?New?Drawing2D.GraphicsPath()
oPath.AddClosedCurve(New?Point()?{New?Point(0,?sender.Height?/?p_1),?New?Point(sender.Width?/?p_1,?0),?New?Point(sender.Width?-?sender.Width?/?p_1,?0),?New?Point(sender.Width,?sender.Height?/?p_1),?New?Point(sender.Width,?sender.Height?-?sender.Height?/?p_1),?New?Point(sender.Width?-?sender.Width?/?p_1,?sender.Height),?_
New?Point(sender.Width?/?p_1,?sender.Height),?New?Point(0,?sender.Height?-?sender.Height?/?p_1)},?CSng(p_2))
sender.Region?=?New?Region(oPath)
End?Sub
Private?Sub?Form1_Load(ByVal?sender?As?System.Object,?ByVal?e?As?System.EventArgs)?Handles?MyBase.Load
Type(Me,?20,?0.1)
End?Sub
設(shè)置Region屬性:
Dim path As New System.Drawing.Drawing2D.GraphicsPath
path.AddEllipse(0, 0, 400, 300)
Region = New Region(path)
VB.NET沒用過
VB6的話用form.circle方法畫圓,圓的半徑和圓點用form.width或者form.height乘以比例數(shù)來得到,然后在form_resize事件中重畫圓就可以了
不知道和VB.NET差別大不大
VB.net
示例:
1.
窗體設(shè)置
邊框模式
2.代碼
Declare
Function
CreateRoundRectRgn
Lib
"gdi32"
Alias
"CreateRoundRectRgn"
(ByVal
X1
As
Int32,
ByVal
Y1
As
Int32,
ByVal
X2
As
Int32,
ByVal
Y2
As
Int32,
ByVal
X3
As
Int32,
ByVal
Y3
As
Int32)
As
Int32
Declare
Function
SetWindowRgn
Lib
"user32"
Alias
"SetWindowRgn"
(ByVal
hWnd
As
Int32,
ByVal
hRgn
As
Int32,
ByVal
bRedraw
As
Boolean)
As
Int32
‘GDI重繪API
Private
Sub
Form1_Load(ByVal
sender
As
Object,
ByVal
e
As
System.EventArgs)
Handles
MyBase.Load
Dim
r
As
Integer
=
CreateRoundRectRgn(0,
0,
Me.Width,
Me.Height,
20,
20)
'CreateRoundRectRgn參數(shù)([窗體左],[窗體頂],[窗體寬],[窗體高],[向左偏移
],[向
偏移
])
SetWindowRgn(Me.Handle,
r,
True)
End
Sub
可以使用onpaint事件進(jìn)行重繪使combobox的是邊框四個直角變成弧形。這里需要用到gdi+繪制的知識和onpait事件。窗體和combobox設(shè)置自動重繪為true即可。你可以參考下gdi的圓角繪制的知識的。這里很容易做到的。希望能幫到你。有疑問繼續(xù)提問哈。