FORM TRANSPARENTE MAS COM TEXTOS E BOX VISIVEIS?

SOUZA 18/06/2014 14:56:11
#438992
Pessoal eu precisava colocar um form em trasparencia mas os textos e demais que estivesem nele nao poderiam sumir junto com o form! a funcao que achei aqui deixa o forma trasnparante inteiro!

Alguma ideia?
SOUZA 18/06/2014 20:06:52
#439009
Ninguem!
TUNUSAT 18/06/2014 22:30:46
#439012
Resposta escolhida
SOUZA,

Precisa usar APIs ... pode ser?
é só colocar todo o código abaixo em um novo form.


Option Explicit
[ô]http://www.vbforums.com/showthread.php?396385-Making-A-Form-Transparent-(But-with-visible-controls)

[ô]bushmobile [ô]s Avatar
[ô]--------------------------------------------------------------------------------
[ô]Join Date:Mar 2004 Location:on the poop deckPosts:5,590
[ô]Making A Form Transparent (But with visible controls)
[ô]To make form transparent, but controls visible:
[ô]VB Code:
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 Const GWL_STYLE = (-16)
Private Const GWL_EXSTYLE = (-20)
Private Const WS_EX_LAYERED = &H80000
Private Const LWA_COLORKEY = &H1
Private Const LWA_ALPHA = &H2

Private Sub Form_Load()
[ô]Me.BorderStyle = 0 [ô]Precisa configurar [Ô]na mão[Ô]
Me.BackColor = vbCyan
SetWindowLong Me.hwnd, GWL_EXSTYLE, GetWindowLong(Me.hwnd, GWL_EXSTYLE) Or WS_EX_LAYERED
SetLayeredWindowAttributes Me.hwnd, vbCyan, 0&, LWA_COLORKEY
End Sub


Detalhe:
Não está funcionando a configuração da propriedade de formulário [Ô]Border Style[Ô] no código ... precisa ir lá nas propriedades do formulário e colocar: [Ô]0 - None[Ô].

[][ô]s,
Tunusat.
SOUZA 19/06/2014 15:07:26
#439033
Valeu tunusat deu certinho obrigado!
Tópico encerrado , respostas não são mais permitidas