Pagina 2 di 2 primaprima 1 2
Visualizzazione dei risultati da 11 a 12 su 12
  1. #11
    Originariamente inviato da dheioo
    Per gli altri, ho provato a fare come dici tu MItaly..ma mi da un sacco di problemi
    "Un sacco di problemi" è un po' generico... che problemi, esattamente?
    Amaro C++, il gusto pieno dell'undefined behavior.

  2. #12
    Utente di HTML.it L'avatar di LMondi
    Registrato dal
    Sep 2004
    Messaggi
    1,291
    ...ma se vuoi passarmi il codice di vb6 qualcosa riuscirò a fare
    Bene, metti sulla Form due RichTextBox:

    codice:
    Option Explicit
    
    'Il colore iniziale di sfondo dei controlli,
    'per ottenere la trasparenza, deve essere bianco:
    
    Const LWA_COLORKEY = &H1
    Const LWA_ALPHA = &H2
    Const GWL_EXSTYLE = (-20)
    Const WS_EX_LAYERED = &H80000
    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 Byte, _
        ByVal dwFlags As Long) As Long
    ' -----------------------------------------------------------
    Private Sub Form_Load()
    
    ' Lo sfondo è trasparente:
        RichTextBox1.BackColor = &H80000005
    ' Lo sfondo NON è trasparente:
       RichTextBox2.BackColor = &HC0FFFF
        
        Dim Ret As Long
        
        Ret = GetWindowLong(Me.hWnd, GWL_EXSTYLE)
        Ret = Ret Or WS_EX_LAYERED
        SetWindowLong Me.hWnd, GWL_EXSTYLE, Ret
        SetLayeredWindowAttributes Me.hWnd, 0, 128, LWA_ALPHA
        SetLayeredWindowAttributes Form1.hWnd, &HFFFFFF, 0, LWA_COLORKEY
    
    End Sub
    Ciao e buon lavoro !
    LM

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 © 2026 vBulletin Solutions, Inc. All rights reserved.