用户自定义控件 界面 不显示问题

来源:互联网 发布:max优化命令英文 编辑:程序博客网 时间:2024/06/05 17:33
 Dim path As System.Drawing.Drawing2D.GraphicsPath
        path = New System.Drawing.Drawing2D.GraphicsPath()
        

        '   path.AddBezier(0, 0, 20, 20, 50, 50, 200, 200)


        '  path.AddRectangle(0, 0, 50, 30)
        path.AddEllipse(0, 0, 50, 30)


        Me.Region = New Region(path)




  Dim g As Graphics
        g = Me.CreateGraphics
        Dim pen As Pen
        pen = New Pen(Brushes.Red)
        '  g.DrawRectangle(pen, 1, 20, 28, 12)
        ' g.DrawRectangle(pen, 60, 20, 28, 12)
        pen.Width = 5
        g.FillRectangle(Brushes.Gold, 0, 0, 50, 30)
        g.Dispose()


与G.draw 不一致


0 0
原创粉丝点击