Controls [vb.net] Round Button
페이지 정보
본문
Private Sub RoundButton(btn As Button)
btn.FlatStyle = FlatStyle.Flat
btn.FlatAppearance.BorderSize = 0
btn.BackColor = Color.Red
btn.ForeColor = Color.White
btn.Cursor = Cursors.Hand
btn.Font = New Font("Century Gothic", 14)
Dim Raduis As New Drawing2D.GraphicsPath
Raduis.StartFigure()
'appends an elliptical arc to the current figure
'left corner top
Raduis.AddArc(New Rectangle(0, 0, 20, 20), 180, 90)
'appends a line segment to the current figure
Raduis.AddLine(10, 0, btn.Width - 20, 0)
'appends an elliptical arc to the current figure
'right corner top
Raduis.AddArc(New Rectangle(btn.Width - 20, 0, 20, 20), -90, 90)
'appends a line segment to the current figure
Raduis.AddLine(btnRound.Width, 20, btn.Width, btn.Height - 10)
'appends an elliptical arc to the current figure
'right corner buttom
Raduis.AddArc(New Rectangle(btn.Width - 25, btn.Height - 25, 25, 25), 0, 90)
'appends a line segment to the current figure
'left corner bottom
Raduis.AddLine(btn.Width - 10, btn.Width, 20, btn.Height)
'appends an elliptical arc to the current figure
Raduis.AddArc(New Rectangle(0, btn.Height - 20, 20, 20), 90, 90)
'Close the current figure and start a new one.
Raduis.CloseFigure()
'set the window associated with the control
btnRound.Region = New Region(Raduis)
End Sub
- 이전글[vb.net] WebClient 파일 업로드 프로세스 바 / BackgroundWorker Progress Display 23.06.14
- 다음글[vb.net] DateTimePicker 전월, 전주, 어제, 오늘, 금주 설정하기 23.05.22
댓글목록
등록된 댓글이 없습니다.