home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frmRound
- Caption = "Round Window"
- ClientHeight = 1515
- ClientLeft = 1080
- ClientTop = 1515
- ClientWidth = 2415
- LinkTopic = "Form1"
- PaletteMode = 1 'UseZOrder
- ScaleHeight = 1515
- ScaleWidth = 2415
- Begin VB.CommandButton Command1
- Caption = "Command1"
- Height = 435
- Left = 660
- TabIndex = 0
- Top = 540
- Width = 915
- End
- Begin VB.PictureBox Picture1
- Height = 780
- Left = 480
- Picture = "Round.frx":0000
- ScaleHeight = 750
- ScaleWidth = 1200
- TabIndex = 1
- Top = 360
- Width = 1230
- End
- Begin VB.Label Label1
- Height = 195
- Left = 60
- TabIndex = 2
- Top = 60
- Width = 2295
- End
- Attribute VB_Name = "frmRound"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- ' Copyright
- 1997 by Desaware Inc. All Rights Reserved
- 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 Command1_Click()
- Label1.BackColor = RGB(0, 255, 0)
- Label1.Caption = "Button clicked"
- End Sub
- Private Sub Form_Load()
- Dim hr&, dl&
- Dim usew&, useh&
- usew& = Command1.Width / Screen.TwipsPerPixelX
- useh& = Command1.Height / Screen.TwipsPerPixelY
- hr& = CreateEllipticRgn(0, 0, usew, useh)
- dl& = SetWindowRgn(Command1.hWnd, hr, True)
- End Sub
- Private Sub Picture1_Click()
- Label1.BackColor = RGB(255, 0, 0)
- Label1.Caption = "Picture clicked"
- End Sub
-