大橙子网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
可以的,下面的这个例子是把picturebox 的形状改成椭圆形的。
成都创新互联公司主要从事网站设计制作、成都网站建设、网页设计、企业做网站、公司建网站等业务。立足成都服务白云鄂,十余年网站建设经验,价格优惠、服务专业,欢迎来电咨询建站服务:028-86922220
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'圆形的picturebox
Me.PictureBox1.BackColor = Color.Red
Dim path1 As New System.Drawing.Drawing2D.GraphicsPath
path1.AddEllipse(New Rectangle(0, 0, 30, 30))
Dim region1 As New System.Drawing.Region(path1)
Me.PictureBox1.Region = region1
End Sub
'我给你找到了,设置region属性就可
Private Sub PictureBox1_DoubleClick(sender As System.Object, e As System.EventArgs) Handles PictureBox1.DoubleClick
If PictureBox1.Region Is Nothing Then
Dim path As New System.Drawing.Drawing2D.GraphicsPath
path.AddEllipse(0, 0, 200, 200)
PictureBox1.Region = New Region(path)
Else
PictureBox1.Region = Nothing
End If
End Sub
'这个双击图片框使其变形,通过GraphicsPath对象可以作出各种形态来,比如可作出文字形状
Dim stringText As String = "我是谁"
Dim family As New FontFamily("Arial")
Dim myfontStyle As Integer = CInt(FontStyle.Italic)
Dim emSize As Integer = 86
Dim origin As New Point(20, 20)
Dim format As StringFormat = StringFormat.GenericDefault
path.AddString(stringText, family, myfontStyle, emSize, _
origin, format)
PictureBox1.Region = New Region(path)
记得VB6当中有Shape控件,但是VB.net里这个控件不存在了。
提个思路:使用Picture控件或Label控件,通过代码在控件里绘图想要的图形,可以试试。
属性里面先把UseWaitCursor改为true然后再改Cursor的属性。选择一个你要的形状