SSTAB
como faço p/ trocar a cor da sstab?
flw
flw
outro exemplo encontrado no site.
http://www.vbmania.com.br/pages/index.php?varModulo=Detalhe&varID=4852
http://www.vbmania.com.br/pages/index.php?varModulo=Detalhe&varID=4852
Só que fica um pouco pesado...
[ô]função para converter a cor do sstab
SetStyle SSTab1.hWnd, cSolidColor
[ô]este ultimo parametro é que define a cor
SetSolidColor SSTab1.hWnd, &H80000013
SSTabSubclass SSTab1.hWnd
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Type GRADIENT_RECT
UPPERLEFT As Long
LOWERRIGHT As Long
End Type
Private Type TRIVERTEX
x As Long
y As Long
Red As Integer
Green As Integer
Blue As Integer
Alpha As Integer
End Type
Private Type RGB
R As Integer
g As Integer
b As Integer
End Type
Private Declare Function BitBlt Lib [Ô]gdi32[Ô] (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Declare Function CallWindowProc Lib [Ô]user32[Ô] Alias [Ô]CallWindowProcA[Ô] (ByVal lpPrevWndFunc As Long, ByVal hWnd As Long, ByVal msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Declare Function CreateBitmap Lib [Ô]gdi32[Ô] (ByVal nWidth As Long, ByVal nHeight As Long, ByVal nPlanes As Long, ByVal nBitCount As Long, lpBits As Any) As Long
Private Declare Function CreateCompatibleDC Lib [Ô]gdi32[Ô] (ByVal hDC As Long) As Long
Private Declare Function CreateCompatibleBitmap Lib [Ô]gdi32[Ô] (ByVal hDC As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Private Declare Function CreatePatternBrush Lib [Ô]gdi32[Ô] (ByVal hBitmap As Long) As Long
Private Declare Function CreateSolidBrush Lib [Ô]gdi32[Ô] (ByVal crColor As Long) As Long
Private Declare Function DeleteObject Lib [Ô]gdi32[Ô] (ByVal hObject As Long) As Long
Private Declare Function DeleteDC Lib [Ô]gdi32[Ô] (ByVal hDC As Long) As Long
Private Declare Function GetProp Lib [Ô]user32[Ô] Alias [Ô]GetPropA[Ô] (ByVal hWnd As Long, ByVal lpString As String) As Long
Private Declare Function GetDC Lib [Ô]user32[Ô] (ByVal hWnd As Long) As Long
Private Declare Function GetSysColor Lib [Ô]user32[Ô] (ByVal nindex As Long) As Long
Private Declare Function GetWindowRect Lib [Ô]user32[Ô] (ByVal hWnd As Long, lpRect As RECT) As Long
Private Declare Function GradientFillRect Lib [Ô]msimg32[Ô] Alias [Ô]GradientFill[Ô] (ByVal hDC As Long, pVertex As TRIVERTEX, ByVal dwNumVertex As Long, pMesh As GRADIENT_RECT, ByVal dwNumMesh As Long, ByVal dwMode As Long) As Long
Private Declare Function KillTimer Lib [Ô]user32[Ô] (ByVal hWnd As Long, ByVal nIDEvent As Long) As Long
Private Declare Function PatBlt Lib [Ô]gdi32[Ô] (ByVal hDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal dwRop As Long) As Long
Private Declare Function RedrawWindow Lib [Ô]user32[Ô] (ByVal hWnd As Long, lprcUpdate As Any, ByVal hrgnUpdate As Long, ByVal fuRedraw As Long) As Long
Private Declare Function ReleaseDC Lib [Ô]user32[Ô] (ByVal hWnd As Long, ByVal hDC As Long) As Long
Private Declare Function SetProp Lib [Ô]user32[Ô] Alias [Ô]SetPropA[Ô] (ByVal hWnd As Long, ByVal lpString As String, ByVal hData As Long) As Long
Private Declare Function SelectObject Lib [Ô]gdi32[Ô] (ByVal hDC As Long, ByVal hObject As Long) As Long
Private Declare Function SetBkColor Lib [Ô]gdi32[Ô] (ByVal hDC As Long, ByVal crColor As Long) As Long
Private Declare Function SetTimer Lib [Ô]user32[Ô] (ByVal hWnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc 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 ValidateRect Lib [Ô]user32[Ô] (ByVal hWnd As Long, ByVal lpRect As Long) As Long
Private Const GWL_WNDPROC As Long = (-4)
Private Const WM_PAINT As Long = &HF
Private Const WM_DESTROY As Long = &H2
Private Const WM_TIMER As Long = &H113
Private Const ID_TIMER As Long = &HCBABE
Public Enum TabStyle
cSolidColor = 0
cPicture = 1
[ô]função para converter a cor do sstab
SetStyle SSTab1.hWnd, cSolidColor
[ô]este ultimo parametro é que define a cor
SetSolidColor SSTab1.hWnd, &H80000013
SSTabSubclass SSTab1.hWnd
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Type GRADIENT_RECT
UPPERLEFT As Long
LOWERRIGHT As Long
End Type
Private Type TRIVERTEX
x As Long
y As Long
Red As Integer
Green As Integer
Blue As Integer
Alpha As Integer
End Type
Private Type RGB
R As Integer
g As Integer
b As Integer
End Type
Private Declare Function BitBlt Lib [Ô]gdi32[Ô] (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Declare Function CallWindowProc Lib [Ô]user32[Ô] Alias [Ô]CallWindowProcA[Ô] (ByVal lpPrevWndFunc As Long, ByVal hWnd As Long, ByVal msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Declare Function CreateBitmap Lib [Ô]gdi32[Ô] (ByVal nWidth As Long, ByVal nHeight As Long, ByVal nPlanes As Long, ByVal nBitCount As Long, lpBits As Any) As Long
Private Declare Function CreateCompatibleDC Lib [Ô]gdi32[Ô] (ByVal hDC As Long) As Long
Private Declare Function CreateCompatibleBitmap Lib [Ô]gdi32[Ô] (ByVal hDC As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Private Declare Function CreatePatternBrush Lib [Ô]gdi32[Ô] (ByVal hBitmap As Long) As Long
Private Declare Function CreateSolidBrush Lib [Ô]gdi32[Ô] (ByVal crColor As Long) As Long
Private Declare Function DeleteObject Lib [Ô]gdi32[Ô] (ByVal hObject As Long) As Long
Private Declare Function DeleteDC Lib [Ô]gdi32[Ô] (ByVal hDC As Long) As Long
Private Declare Function GetProp Lib [Ô]user32[Ô] Alias [Ô]GetPropA[Ô] (ByVal hWnd As Long, ByVal lpString As String) As Long
Private Declare Function GetDC Lib [Ô]user32[Ô] (ByVal hWnd As Long) As Long
Private Declare Function GetSysColor Lib [Ô]user32[Ô] (ByVal nindex As Long) As Long
Private Declare Function GetWindowRect Lib [Ô]user32[Ô] (ByVal hWnd As Long, lpRect As RECT) As Long
Private Declare Function GradientFillRect Lib [Ô]msimg32[Ô] Alias [Ô]GradientFill[Ô] (ByVal hDC As Long, pVertex As TRIVERTEX, ByVal dwNumVertex As Long, pMesh As GRADIENT_RECT, ByVal dwNumMesh As Long, ByVal dwMode As Long) As Long
Private Declare Function KillTimer Lib [Ô]user32[Ô] (ByVal hWnd As Long, ByVal nIDEvent As Long) As Long
Private Declare Function PatBlt Lib [Ô]gdi32[Ô] (ByVal hDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal dwRop As Long) As Long
Private Declare Function RedrawWindow Lib [Ô]user32[Ô] (ByVal hWnd As Long, lprcUpdate As Any, ByVal hrgnUpdate As Long, ByVal fuRedraw As Long) As Long
Private Declare Function ReleaseDC Lib [Ô]user32[Ô] (ByVal hWnd As Long, ByVal hDC As Long) As Long
Private Declare Function SetProp Lib [Ô]user32[Ô] Alias [Ô]SetPropA[Ô] (ByVal hWnd As Long, ByVal lpString As String, ByVal hData As Long) As Long
Private Declare Function SelectObject Lib [Ô]gdi32[Ô] (ByVal hDC As Long, ByVal hObject As Long) As Long
Private Declare Function SetBkColor Lib [Ô]gdi32[Ô] (ByVal hDC As Long, ByVal crColor As Long) As Long
Private Declare Function SetTimer Lib [Ô]user32[Ô] (ByVal hWnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc 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 ValidateRect Lib [Ô]user32[Ô] (ByVal hWnd As Long, ByVal lpRect As Long) As Long
Private Const GWL_WNDPROC As Long = (-4)
Private Const WM_PAINT As Long = &HF
Private Const WM_DESTROY As Long = &H2
Private Const WM_TIMER As Long = &H113
Private Const ID_TIMER As Long = &HCBABE
Public Enum TabStyle
cSolidColor = 0
cPicture = 1
Utilize o Xtab.ocx é free
Em anexo o XTab, eu uso ele, muito bom.
Tópico encerrado , respostas não são mais permitidas