VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



To Hide Your Form Completely For A While, N Then Appear.

by Divyalok (1 Submission)
Category: Windows API Call/Explanation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 5th June 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

To Hide Your Form Completely For A While, N Then Appear.

API Declarations


Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Long) As Long


Rate To Hide Your Form Completely For A While, N Then Appear.



'1st button's caption "Hide" n second's "Exit".
'Add This Code.

Private Sub Command1_Click()

    Dim lngRegion As Long
    Dim lngReturn As Long
    Dim lngFormWidth As Long
    Dim lngFormHeight As Long
    
    lngRegion = CreateEllipticRgn(0, 0, Me.Width, Me.Height)
    lngReturn = SetWindowRgn(Me.hWnd, lngRegion, True)
End Sub

Private Sub Command2_Click()
End
End Sub

Private Sub Timer1_Timer()
    
    lngFormWidth = Me.Width / Screen.TwipsPerPixelX
    lngFormHeight = Me.Height / Screen.TwipsPerPixelY
    lngReturn = SetWindowRgn(Me.hWnd, lngRegion, True)
End Sub

Download this snippet    Add to My Saved Code

To Hide Your Form Completely For A While, N Then Appear. Comments

No comments have been posted about To Hide Your Form Completely For A While, N Then Appear.. Why not be the first to post a comment about To Hide Your Form Completely For A While, N Then Appear..

Post your comment

Subject:
Message:
0/1000 characters