Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    form trasparenza totale

    come rendere un form in trasparenza totale?
    i miei post sono RIFERITI TUTTI A VISUAL BASIC 6
    MSN MESSENGER : magicolotto@hotmail.it

  2. #2
    Utente di HTML.it L'avatar di yyzyyz
    Registrato dal
    Oct 2001
    Messaggi
    1,653
    ciao Magicolotto, prova questa funzione dovrebbe fare al caso tuo.

    codice:
    Option Explicit
    
    Private Const GWL_EXSTYLE As Long = (-20)
    Private Const WS_EX_RIGHT As Long = &H1000
    Private Const WS_EX_LEFTSCROLLBAR As Long = &H4000
    Private Const WS_EX_LAYERED As Long = &H80000
    Private Const WS_EX_TRANSPARENT = &H20&
    Private Const LWA_COLORKEY As Long = &H1
    Private Const LWA_ALPHA As Long = &H2
    
    Private Declare Function GetWindowLong Lib "User32" _
       Alias "GetWindowLongA" _
      (ByVal hwnd As Long, _
       ByVal nIndex As Long) As Long
    
    Private Declare Function SetWindowLong 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 Long, _
       ByVal dwFlags As Long) As Long
    Private Sub Form_Load()
        
    Call formtrasparente
                 
    End Sub
    
    Private Function formtrasparente()
    
       Dim style As Long
       Dim alpha As Integer
       
       alpha = 120 ' setta trasparenza form (0 - 255)
       
       style = GetWindowLong(Me.hwnd, GWL_EXSTYLE)
       
       If Not (style And WS_EX_LAYERED = WS_EX_LAYERED) Then
          
          style = style Or WS_EX_LAYERED
          SetWindowLong Me.hwnd, GWL_EXSTYLE, style
          SetLayeredWindowAttributes Me.hwnd, 0&, alpha, LWA_ALPHA
       End If
        
    End Function

  3. #3
    Sei di una squisitezza e gentilezza insuperabile

    grazieeeeee
    i miei post sono RIFERITI TUTTI A VISUAL BASIC 6
    MSN MESSENGER : magicolotto@hotmail.it

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.