【VB开源代码栏目提醒】:以下是网学会员为您推荐的VB开源代码-26.frm,希望本篇文章对您学习有所帮助。
VERSION 5.00
Begin VB.Form Form1
Caption = "圆形窗体 圆形窗体和弹出式菜单"
ClientHeight = 4410
ClientLeft = 60
ClientTop = 345
ClientWidth = 6405
LinkTopic = "Form1"
ScaleHeight = 4410
ScaleWidth = 6405
StartUpPosition = 3 '窗口缺省
Begin VB.PictureBox Picture1
Height = 4455
Left = 0
Picture = "26.frx":0000
ScaleHeight = 4395
ScaleWidth = 6435
TabIndex = 0
Top = 0
Width = 6495
End
Begin VB.Menu File
Caption = "文件"
Visible = 0 'False
Begin VB.Menu Open
Caption = "打开"
End
Begin VB.Menu Save
Caption = "保存"
End
Begin VB.Menu Fsave
Caption = "另存为"
End
Begin VB.Menu copy
Caption = "复制"
End
Begin VB.Menu like
Caption = "-"
End
Begin VB.Menu Exit
Caption = "退出"
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function CreateEllipticRgn Lib "gdi32" (ByVal x1 As Long, ByVal y1 As Long, ByVal x2 As Long, ByVal y2 As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Long) As Long
Private Sub Exit_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim h, d As Long
Dim scrw, scrh As Long
scrw = Me.Width / Screen.TwipsPerPixelX
scrh = Me.Height / Screen.TwipsPerPixelY
h = CreateEllipticRgn(0, 0, scrw, scrh)
d = SetWindowRgn(Me.hWnd, h, True)
End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then
PopupMenu File, 0, Me.ScaleHeight, Me.ScaleWidth
ElseIf Button = 1 Then
PopupMenu File, 0, Me.ScaleHeight / 2, Me.ScaleWidth / 2
Else
PopupMenu File, 0, Me.ScaleLeft, Me.ScaleWidth
End If
End Sub