Maximßlnφ dΘlka editovatelnΘho textu v n≤du

Postup:
Deklarujte:

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
        (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _
        lParam As Any) As Long

Private Const TV_FIRST = &H1100
Private Const TVM_GETEDITCONTROL = TV_FIRST + 15
Private Const EM_LIMITTEXT = &HC5

Public Sub SetTextLen(tvw As Treeview, intSize As Integer)

   Dim lngHwnd As Long

   lngHwnd = SendMessage(tvw.hwnd, TVM_GETEDITCONTROL, 0, 0)

   If lngHwnd <> 0
      SendMessage lngHwnd, EM_LIMITTEXT, intSize, 0
   End If

End Sub

Pou₧itφ:
SetTextLen TreeView1, 50

Zp∞t

Autor: The Bozena