[vb.net] Round Button > vb.net

본문 바로가기

vb.net

[Controls] [vb.net] Round Button

회원사진
하나를하더라도최선을
2023-06-07 08:46 1,434 0

본문



    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(002020), 18090)
        'appends a line segment to the current figure
        Raduis.AddLine(100, btn.Width - 200)
        'appends an elliptical arc to the current figure
        'right corner top
        Raduis.AddArc(New Rectangle(btn.Width - 2002020), -9090)
        '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 - 252525), 090)
        '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 - 202020), 9090)
        '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

57d65d71031352e44a2bcc8a65370151_1686094944_8348.png
 

댓글목록0

등록된 댓글이 없습니다.
게시판 전체검색