|
Данный пример покажет, как можно ограничить
длину любого элемента (в количестве символов) ComboBox.
Расположите на форме элемент CommandButton. Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal
wCmd As Long) As Long
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
Const EM_LIMITTEXT = &HC5
Const GW_CHILD = 5
Private Sub Command1_Click()
'установить длину элемента - 4 символа
SendMessage GetWindow(Combo1.hwnd, GW_CHILD), EM_LIMITTEXT, 4, ByVal 0
End Sub
|
|