ACTIVESKIN
Bom dia programadores, estou com um pequeno grande problema.
Estou desenvolvendo um novo sistema, e quis melhorar o o visual do meu programa, e instalei o activeskin, porem ele é incompativel com alguns objetos do vb, tipo o IMAGE. qdo rodo a skin ele não aparece meus images, alguem sabe o que fazer com estes componentes que não aparecem qdo a skin esta aplicada?
Desde já agradeço a ajuda de todos.
Estou desenvolvendo um novo sistema, e quis melhorar o o visual do meu programa, e instalei o activeskin, porem ele é incompativel com alguns objetos do vb, tipo o IMAGE. qdo rodo a skin ele não aparece meus images, alguem sabe o que fazer com estes componentes que não aparecem qdo a skin esta aplicada?
Desde já agradeço a ajuda de todos.
Pessoal, obrigado pelas dicas.
Bom vamos lá.
GOODSPEAKERS - Kra não deu certo, uma q ela não fica sobre o componente do skin. mas mesmo assim valeu pela força.
MACYZYN - Kra é uma boa ideÃa só que a stab tbm não pega o visual do skin, ai tentei o frame, que ele pega o visual, porem ele esconde o image tbm. Mas ficou + ou - vou continuar pesquisando pra ver se acho algo.
BARROS - Kra o que vc disse funcionou perfeitamente, porem o form fiicou sem pegar o visual da skin, mas testei um frame e ele pegou a cor do skin acho q vai ser isso mesmo q vou fazer.
Desde já agradeço a todos.
Até mais.
Bom vamos lá.
GOODSPEAKERS - Kra não deu certo, uma q ela não fica sobre o componente do skin. mas mesmo assim valeu pela força.
MACYZYN - Kra é uma boa ideÃa só que a stab tbm não pega o visual do skin, ai tentei o frame, que ele pega o visual, porem ele esconde o image tbm. Mas ficou + ou - vou continuar pesquisando pra ver se acho algo.
BARROS - Kra o que vc disse funcionou perfeitamente, porem o form fiicou sem pegar o visual da skin, mas testei um frame e ele pegou a cor do skin acho q vai ser isso mesmo q vou fazer.
Desde já agradeço a todos.
Até mais.
vc pode colocar uma picture, depois vc deixa ela transparente ....
naum sei se funciona ...
pictransparente SuaPicture
[txt-color=#e80000]
Option Explicit
Private Declare Function GetDC Lib [Ô]user32[Ô] (ByVal hwnd As Long) As Long
Private Declare Function DeleteObject Lib [Ô]gdi32[Ô] (ByVal hObject As Long) As Long
Private Declare Function CreateRectRgn Lib [Ô]gdi32[Ô] (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function CombineRgn Lib [Ô]gdi32[Ô] (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
Private Declare Function GetPixel Lib [Ô]gdi32[Ô] (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long) As Long
Private Declare Function SetWindowRgn Lib [Ô]user32[Ô] (ByVal hwnd As Long, ByVal hRgn As Long, ByVal bRedraw As Long) As Long
[ô]Variablen
Public cmdDc As Long
Public Function picTranz(cPic As PictureBox) As Long
Dim lHoch As Long
Dim lBreit As Long
Dim lTemp As Long
Dim lSkin As Long
Dim lStart As Long
Dim lZeile As Long
Dim lSpalte As Long
Dim lBackColor As Long
[ô]Rechteck erstellen mit Größe = 0
lSkin = CreateRectRgn(0, 0, 0, 0)
With cPic
[ô]Höhe und Breite auslesen
lHoch = .Height / 15
lBreit = .Width / 15
[ô]Hintergrundfarbe auslesen, die entfernt werden soll
lBackColor = GetPixel(.hdc, 0, 0)
[ô]Zeilenweise kleine Rechtecke erstellen
For lZeile = 0 To lHoch - 1
lSpalte = 0
Do While lSpalte < lBreit
Do While lSpalte < lBreit And _
GetPixel(.hdc, lSpalte, lZeile) = lBackColor
lSpalte = lSpalte + 1
Loop
If lSpalte < lBreit Then
lStart = lSpalte
Do While lSpalte < lBreit And _
GetPixel(.hdc, lSpalte, lZeile) <> lBackColor
lSpalte = lSpalte + 1
Loop
If lSpalte > lBreit Then lSpalte = lBreit
[ô]Kleines Rechteck erstellen
lTemp = _
CreateRectRgn(lStart, lZeile, lSpalte, lZeile + 1)
[ô]Kleines Rechteck der bisherigen Schablone hinzufügen
Call CombineRgn(lSkin, lSkin, lTemp, 2)
[ô]Kleines Rechteck wieder löschen
Call DeleteObject(lTemp)
End If
Loop
Next lZeile
End With
[ô]Schablone an Funktion übergeben
picTranz = lSkin
End Function
Public Sub picTransparent(cPic As PictureBox)
Dim lSkin As Long
[ô]Eigenschaften der PictureBox ändern
With cPic
[ô].Visible = True
[ô].Left = 0
[ô].Top = 0
.BorderStyle = 0
.AutoRedraw = True
.AutoSize = True
[ô]Schablone erstellen
lSkin = picTranz(cPic)
[ô]Skin aus Schablone erstellen
Call SetWindowRgn(cPic.hwnd, lSkin, True)
End With
End Sub
Public Function cmdTranz(cBttn As CommandButton) As Long
Dim lHoch As Long
Dim lBreit As Long
Dim lTemp As Long
Dim lSkin As Long
Dim lStart As Long
Dim lZeile As Long
Dim lSpalte As Long
Dim lBackColor As Long
[ô]Rechteck erstellen mit Größe = 0
lSkin = CreateRectRgn(0, 0, 0, 0)
With cBttn
[ô]Höhe und Breite auslesen
lHoch = .Height / 15
lBreit = .Width / 15
[ô]Da der Commandbutton keine hdc-Eigenschaft hat...
cmdDc = GetDC(.hwnd)
[ô]Hintergrundfarbe setzen, die entfernt werden soll
lBackColor = cBttn.BackColor
[ô]Zeilenweise kleine Rechtecke erstellen
For lZeile = 2 To lHoch - 3
lSpalte = 2
Do While lSpalte < (lBreit - 3)
Do While lSpalte < (lBreit - 3) And _
GetPixel(cmdDc, lSpalte, lZeile) = lBackColor
lSpalte = lSpalte + 1
Loop
If lSpalte < (lBreit - 3) Then
lStart = lSpalte
Do While lSpalte < (lBreit - 3) And _
GetPixel(cmdDc, lSpalte, lZeile) <> lBackColor
lSpalte = lSpalte + 1
Loop
If lSpalte > lBreit Then lSpalte = lBreit
[ô]Kleines Recheck erstellen
lTemp = _
CreateRectRgn(lStart, lZeile, lSpalte, lZeile + 1)
[ô]Kleines Rechteck der bisherigen Schablone hinzufügen
Call CombineRgn(lSkin, lSkin, lTemp, 2)
[ô]Kleines Rechteck wieder löschen
Call DeleteObject(lTemp)
End If
Loop
Next lZeile
End With
[ô]Schablone an Funktion übergeben
cmdTranz = lSkin
End Function
Public Sub cmdTransparent(cBttn As CommandButton)
Dim lSkin As Long
[ô]Eingenschaften der PictureBox ändern
With cBttn
.Visible = True
[ô].Left = cBttn.Left
[ô].Top = cBttn.Top
[ô]Schablone erstellen
lSkin = cmdTranz(cBttn)
[ô]Skin aus Schablone erstellen
Call SetWindowRgn(cBttn.hwnd, lSkin, True)
End With
End Sub
[/txt-color]
naum sei se funciona ...
pictransparente SuaPicture
[txt-color=#e80000]
Option Explicit
Private Declare Function GetDC Lib [Ô]user32[Ô] (ByVal hwnd As Long) As Long
Private Declare Function DeleteObject Lib [Ô]gdi32[Ô] (ByVal hObject As Long) As Long
Private Declare Function CreateRectRgn Lib [Ô]gdi32[Ô] (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function CombineRgn Lib [Ô]gdi32[Ô] (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
Private Declare Function GetPixel Lib [Ô]gdi32[Ô] (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long) As Long
Private Declare Function SetWindowRgn Lib [Ô]user32[Ô] (ByVal hwnd As Long, ByVal hRgn As Long, ByVal bRedraw As Long) As Long
[ô]Variablen
Public cmdDc As Long
Public Function picTranz(cPic As PictureBox) As Long
Dim lHoch As Long
Dim lBreit As Long
Dim lTemp As Long
Dim lSkin As Long
Dim lStart As Long
Dim lZeile As Long
Dim lSpalte As Long
Dim lBackColor As Long
[ô]Rechteck erstellen mit Größe = 0
lSkin = CreateRectRgn(0, 0, 0, 0)
With cPic
[ô]Höhe und Breite auslesen
lHoch = .Height / 15
lBreit = .Width / 15
[ô]Hintergrundfarbe auslesen, die entfernt werden soll
lBackColor = GetPixel(.hdc, 0, 0)
[ô]Zeilenweise kleine Rechtecke erstellen
For lZeile = 0 To lHoch - 1
lSpalte = 0
Do While lSpalte < lBreit
Do While lSpalte < lBreit And _
GetPixel(.hdc, lSpalte, lZeile) = lBackColor
lSpalte = lSpalte + 1
Loop
If lSpalte < lBreit Then
lStart = lSpalte
Do While lSpalte < lBreit And _
GetPixel(.hdc, lSpalte, lZeile) <> lBackColor
lSpalte = lSpalte + 1
Loop
If lSpalte > lBreit Then lSpalte = lBreit
[ô]Kleines Rechteck erstellen
lTemp = _
CreateRectRgn(lStart, lZeile, lSpalte, lZeile + 1)
[ô]Kleines Rechteck der bisherigen Schablone hinzufügen
Call CombineRgn(lSkin, lSkin, lTemp, 2)
[ô]Kleines Rechteck wieder löschen
Call DeleteObject(lTemp)
End If
Loop
Next lZeile
End With
[ô]Schablone an Funktion übergeben
picTranz = lSkin
End Function
Public Sub picTransparent(cPic As PictureBox)
Dim lSkin As Long
[ô]Eigenschaften der PictureBox ändern
With cPic
[ô].Visible = True
[ô].Left = 0
[ô].Top = 0
.BorderStyle = 0
.AutoRedraw = True
.AutoSize = True
[ô]Schablone erstellen
lSkin = picTranz(cPic)
[ô]Skin aus Schablone erstellen
Call SetWindowRgn(cPic.hwnd, lSkin, True)
End With
End Sub
Public Function cmdTranz(cBttn As CommandButton) As Long
Dim lHoch As Long
Dim lBreit As Long
Dim lTemp As Long
Dim lSkin As Long
Dim lStart As Long
Dim lZeile As Long
Dim lSpalte As Long
Dim lBackColor As Long
[ô]Rechteck erstellen mit Größe = 0
lSkin = CreateRectRgn(0, 0, 0, 0)
With cBttn
[ô]Höhe und Breite auslesen
lHoch = .Height / 15
lBreit = .Width / 15
[ô]Da der Commandbutton keine hdc-Eigenschaft hat...
cmdDc = GetDC(.hwnd)
[ô]Hintergrundfarbe setzen, die entfernt werden soll
lBackColor = cBttn.BackColor
[ô]Zeilenweise kleine Rechtecke erstellen
For lZeile = 2 To lHoch - 3
lSpalte = 2
Do While lSpalte < (lBreit - 3)
Do While lSpalte < (lBreit - 3) And _
GetPixel(cmdDc, lSpalte, lZeile) = lBackColor
lSpalte = lSpalte + 1
Loop
If lSpalte < (lBreit - 3) Then
lStart = lSpalte
Do While lSpalte < (lBreit - 3) And _
GetPixel(cmdDc, lSpalte, lZeile) <> lBackColor
lSpalte = lSpalte + 1
Loop
If lSpalte > lBreit Then lSpalte = lBreit
[ô]Kleines Recheck erstellen
lTemp = _
CreateRectRgn(lStart, lZeile, lSpalte, lZeile + 1)
[ô]Kleines Rechteck der bisherigen Schablone hinzufügen
Call CombineRgn(lSkin, lSkin, lTemp, 2)
[ô]Kleines Rechteck wieder löschen
Call DeleteObject(lTemp)
End If
Loop
Next lZeile
End With
[ô]Schablone an Funktion übergeben
cmdTranz = lSkin
End Function
Public Sub cmdTransparent(cBttn As CommandButton)
Dim lSkin As Long
[ô]Eingenschaften der PictureBox ändern
With cBttn
.Visible = True
[ô].Left = cBttn.Left
[ô].Top = cBttn.Top
[ô]Schablone erstellen
lSkin = cmdTranz(cBttn)
[ô]Skin aus Schablone erstellen
Call SetWindowRgn(cBttn.hwnd, lSkin, True)
End With
End Sub
[/txt-color]
Bom voce pode usar componentes de terceiros.
Aqui no site ou no www.planet-source-code.com tem vários exemplos de controles comuns.
Entre eles, o aerosuite e o vkcontrol.
Ele possui o controle label, voce pode copiar o usercontrol e o modulo onde se encontra as apis enums etc, para funcionar.
Eu faço isso, eu tenho a minha propria biblioteca de OCX para fazer os meus projetos.
Aqui no site ou no www.planet-source-code.com tem vários exemplos de controles comuns.
Entre eles, o aerosuite e o vkcontrol.
Ele possui o controle label, voce pode copiar o usercontrol e o modulo onde se encontra as apis enums etc, para funcionar.
Eu faço isso, eu tenho a minha propria biblioteca de OCX para fazer os meus projetos.
Tópico encerrado , respostas não são mais permitidas