Results 1 to 4 of 4

Thread: Transparent form

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2005
    Posts
    230

    Transparent form

    hi guy,

    can anybody help me, regarding an issue, i try to make a full screen transparent form and user can click on the desktop icons/shortcuts while the form is open, there's a lot of code for transparent but none corresponding to what i try to do

  2. #2
    Just a Member! seenu_1st's Avatar
    Join Date
    Aug 2007
    Location
    India
    Posts
    2,170

    Re: Transparent form

    link got a sample exactly what u want, it has multiple cuts, u hav to modify to ur requirement.
    Seenu

    If this post is useful, pls don't forget to Rate this post.
    Pls mark thread as resolved once ur problem solved.
    ADO Tutorial Variable types SP6 for VB6, MsFlexGrid fast fill, Sorting Algorithms


  3. #3
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Transparent form

    I like this one

    Code:
    Option Explicit
    
    Private Declare Function SetWindowLongptr Lib "user32" Alias "SetWindowLongA" _
    (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
    
    Private Declare Function SetLayeredWindowAttributes Lib "user32" _
    (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
    
    '
    ' Constants for SetWindowLongptr
    '
    Private Const GWL_EXSTYLE = (-20)
    Private Const WS_EX_LAYERED = &H80000
    
    '
    ' Constants for SetLayeredWindowAttributes
    '
    Private Const LWA_ALPHA = &H2
    Private Const LWA_COLORKEY = &H1
    
    Dim BytAlpha As Byte, ColMsk As Long
    
    Private Sub Command3_Click()
     BytAlpha = BytAlpha - 1
    
     SetWindowLongptr hWnd, GWL_EXSTYLE, WS_EX_LAYERED
     SetLayeredWindowAttributes hWnd, ColMsk, BytAlpha, LWA_COLORKEY Or LWA_ALPHA
    End Sub
    
    Private Sub Form_Load()
     BytAlpha = 255 '190 '250
     ColMsk = &HFF8888
     Me.BackColor = ColMsk
    
     SetWindowLongptr hWnd, GWL_EXSTYLE, WS_EX_LAYERED
     SetLayeredWindowAttributes hWnd, ColMsk, BytAlpha, LWA_COLORKEY Or LWA_ALPHA
    End Sub
    
    Private Sub Command1_Click()
     MsgBox "Hello, All you can see are the two buttons"
    End Sub
    
    Private Sub Command2_Click()
     If MsgBox("Do you want to quit?", vbYesNo) = vbYes Then
       End
     End If
    End Sub


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  4. #4
    Just a Member! seenu_1st's Avatar
    Join Date
    Aug 2007
    Location
    India
    Posts
    2,170

    Re: Transparent form

    yes good one.
    Seenu

    If this post is useful, pls don't forget to Rate this post.
    Pls mark thread as resolved once ur problem solved.
    ADO Tutorial Variable types SP6 for VB6, MsFlexGrid fast fill, Sorting Algorithms


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width