⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 用VB制作椭圆形窗体
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   BorderStyle     =   0  'None
   Caption         =   "Form1"
   ClientHeight    =   5055
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   7635
   LinkTopic       =   "Form1"
   Picture         =   "Form1.frx":0000
   ScaleHeight     =   5055
   ScaleWidth      =   7635
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  '所有者中心
   Begin VB.PictureBox Picture1 
      BorderStyle     =   0  'None
      Height          =   2595
      Index           =   2
      Left            =   -15
      Picture         =   "Form1.frx":7E6FC
      ScaleHeight     =   2595
      ScaleWidth      =   3855
      TabIndex        =   3
      Top             =   2565
      Visible         =   0   'False
      Width           =   3855
   End
   Begin VB.PictureBox Picture1 
      BorderStyle     =   0  'None
      Height          =   2595
      Index           =   3
      Left            =   3840
      Picture         =   "Form1.frx":9DBD8
      ScaleHeight     =   2595
      ScaleWidth      =   3855
      TabIndex        =   4
      Top             =   2565
      Visible         =   0   'False
      Width           =   3855
   End
   Begin VB.PictureBox Picture1 
      BorderStyle     =   0  'None
      Height          =   2595
      Index           =   1
      Left            =   3840
      Picture         =   "Form1.frx":BCB84
      ScaleHeight     =   2595
      ScaleWidth      =   3855
      TabIndex        =   2
      Top             =   0
      Visible         =   0   'False
      Width           =   3855
   End
   Begin VB.PictureBox Picture1 
      BorderStyle     =   0  'None
      Height          =   2595
      Index           =   0
      Left            =   0
      Picture         =   "Form1.frx":DD014
      ScaleHeight     =   2595
      ScaleWidth      =   3855
      TabIndex        =   0
      Top             =   0
      Visible         =   0   'False
      Width           =   3855
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Height          =   2475
      Index           =   3
      Left            =   3795
      TabIndex        =   7
      Top             =   2655
      Width           =   3795
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Height          =   2595
      Index           =   2
      Left            =   75
      TabIndex        =   6
      Top             =   2535
      Width           =   3735
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Height          =   2595
      Index           =   1
      Left            =   3840
      TabIndex        =   5
      Top             =   0
      Width           =   3735
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "                       "
      ForeColor       =   &H000000FF&
      Height          =   2580
      Index           =   0
      Left            =   -30
      TabIndex        =   1
      Top             =   30
      Width           =   3855
   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 Form_Load()
  Dim a, b As Long
  Dim w, h As Long
  w = Form1.Width / Screen.TwipsPerPixelX
  h = Form1.Height / Screen.TwipsPerPixelY
  a = CreateEllipticRgn(0, 0, w, h)
  b = SetWindowRgn(Me.hWnd, a, True)              '设置椭圆形窗体
End Sub
Private Sub Form_Activate()
  Picture1(0).Visible = True
End Sub

Private Sub Label1_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
      Picture1(0).Visible = False
      Picture1(1).Visible = False
      Picture1(2).Visible = False
      Picture1(3).Visible = False
  Select Case Index
    Case Is = 0
      Picture1(0).Visible = True                 '鼠标所在位置图形突起
    Case Is = 1
      Picture1(1).Visible = True                 '鼠标所在位置图形突起
    Case Is = 2
      Picture1(2).Visible = True                 '鼠标所在位置图形突起
    Case Is = 3
      Picture1(3).Visible = True                 '鼠标所在位置图形突起
  End Select
End Sub

Private Sub Picture1_Click(Index As Integer)
  End
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -