• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • 在VB.Net中定制任意形狀的按鈕

    發表于:2007-05-25來源:作者:點擊數: 標簽:任意形狀VB.NET思路按鈕
    思路: 首先,創建一個Point對象數組,為按鈕定制多邊形。接著創建一個GraphicsPath對象,在其中添加多邊形。再將GraphicsPath轉化為Region。最后,將按鈕的Region屬性設置為前面得到的結果。 具體代碼: Private Sub Form1_Load(ByVal sender As System.Obj
    思路:
        首先,創建一個Point對象數組,為按鈕定制多邊形。接著創建一個GraphicsPath對象,在其中添加多邊形。再將GraphicsPath轉化為Region。最后,將按鈕的Region屬性設置為前面得到的結果。
         
    具體代碼:
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal _
        e As System.EventArgs) Handles MyBase.Load
        ' 定義多邊形路徑中的點
        Dim pts() As Point = { _
            New Point(5, 15), _
            New Point(35, 15), _
            New Point(35, 5), _
            New Point(55, 25), _
            New Point(35, 45), _
            New Point(35, 35), _
            New Point(5, 35) _
        }

        ' 形成GraphicsPath
        Dim polygon_path As New System.Drawing.Drawing2D.GraphicsPath(FillMode.Winding)
        polygon_path.AddPolygon(pts)

        ' 將GraphicsPath轉為Region
        Dim polygon_region = New Region(polygon_path)

        ' 將按鈕約束在Region內
        Button1.Region = polygon_region

        ' 讓按鈕填充Region
        Button1.SetBounds(Button1.Location.X, Button1.Location.Y, pts(3).X + 5, pts(4).Y + 5)
    End Sub

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>