Как поменять САБЖ?
Белый достал уже
Мож сообщение какое отправить или стили присвоить
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Const TVM_SETBKCOLOR As Long = &H1100 + 29
Private Sub Form_DblClick()
SendMessage TreeView1.hwnd, TVM_SETBKCOLOR, 0, vbRed
End Sub
GSerg писал(а):Ещё есть TVM_SETTEXTCOLOR и TVM_SETLINECOLOR.
Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As Long, ByVal Msg As Long, wParam As Any, lParam As Any) As Long
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 Const GWL_STYLE = -16&
Private Const TVM_SETBKCOLOR = 4381&
Private Const TVM_GETBKCOLOR = 4383&
Private Const TVS_HASLINES = 2&
SendMessage tree_view.hwnd, 4381&, 0, ByVal vbBlack
lngStyle = GetWindowLong(tree_view.hwnd, GWL_STYLE)
Call SetWindowLong(tree_view.hwnd, GWL_STYLE, lngStyle - TVS_HASLINES)
For i = 1 To TreeView1.Nodes.Count
TreeView1.Nodes.Item(i).BackColor = vbYellow 'RGB(50, 50, 100) 'цвет фона итема
TreeView1.Nodes.Item(i).ForeColor = vbBlack 'цвет фона шрифта
Next i
Сейчас этот форум просматривают: AhrefsBot и гости: 3