Bosan dengan tampilan toolbar standar di VB 6?? Coba anda modif sedikit dengan memberi warna dengan langkah-langkah sbb:
Buatlah sebuah Module lalu ketik:
Private Declare Function SetClassLong Lib "user32" Alias "SetClassLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwnewlong As Long) As Long
Private Declare Function OleTranslateColor Lib "oleaut32.dll" (ByVal lOleColor As Long, ByVal lHPalette As Long, ByRef lColorRef As Long) As Long
Private Declare Function CreateSolidBrush Lib "gdi32.dll" (ByVal crColor As Long) As Long
Private Declare Function DeleteObject Lib "gdi32.dll" (ByVal hObject As Long) As Long
Public Sub SetTlbColor(ByVal Tlb As Toolbar, ByVal Color As OLE_COLOR)
Dim l As Long
If OleTranslateColor(Color, 0, l) Then l = &HFFFF&
DeleteObject SetClassLong(Tlb.hwnd, -10, CreateSolidBrush(l))
End Sub
Untuk menggunakan, buat sebuah Form baru dengan kontrol ToolBar (Style=tbrFlat) didalamnya. Lalu ketikkan kode berikut di 'Form_Load':
SetTlbColor Toolbar1, vbBlue
DOWNLOAD PROJECT
0 komentar:
Posting Komentar