扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:马金虎 来源:天极网 2007年11月9日
关键字:
图02:【VB.NET中定制不规则窗体】项目的设计界面 |
Private Sub Button1_Click ( ByVal sender As System.Object , ByVal e As System.EventArgs ) Handles Button1.Click Dim p As System.Drawing.Drawing2D.GraphicsPath = New System.Drawing.Drawing2D.GraphicsPath ( ) Dim Width As Integer = Me.ClientSize.Width Dim Height As Integer = Me.ClientSize.Height p.AddEllipse ( 0 , 20 , Width - 50 , Height - 100 ) '根据要绘制椭圆的形状来填写AddEllipse方法中椭圆对应的相应参数 Region = New Region ( p ) End Sub |
Private Sub Button2_Click ( ByVal sender As System.Object , ByVal e As System.EventArgs ) Handles Button2.Click Dim p As System.Drawing.Drawing2D.GraphicsPath = New System.Drawing.Drawing2D.GraphicsPath ( ) p.AddPie ( 10 , 10 , 250 , 250 , 5 , 150 ) '根据要实现的扇形形状来填写AddPie方法中的相应参数 Me.Region = New Region ( p ) End Sub |
Private Sub Button3_Click ( ByVal sender As System.Object , ByVal e As System.EventArgs ) Handles Button3.Click Dim p As System.Drawing.Drawing2D.GraphicsPath = New System.Drawing.Drawing2D.GraphicsPath ( ) Dim Width As Integer = Me.ClientSize.Width Dim Height As Integer = Me.ClientSize.Height p.AddEllipse ( 0 , 0 , Height , Height ) Me.Region = New Region ( p ) '圆形即是椭圆的一种特例, End Sub |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。