|
|
Высота - Длинна текста внутри Элемента Управления в твипах
В коде:
Dim sCtrlText$, lx As Long, ly As Long
WizHook.Key = 51488399
WizHook.TwipsFromFont Ctrl.FontName, Ctrl.FontSize, Ctrl.FontWeight, _
Ctrl.FontItalic, Ctrl.FontUnderline, 0, sCtrlText, 0, lx, ly
Функция:
Public Function WizHook_TwipsFromFont(Ctrl As Control, Optional blnRetWidth As Boolean = False) As Long
Dim sCtrlText$, lx As Long, ly As Long
Select Case Ctrl.ControlType
Case acLabel: sCtrlText = Ctrl.Caption
Case acTextBox: sCtrlText = Ctrl.Text
Case Else: Exit Function
End Select
WizHook.Key = 51488399
WizHook.TwipsFromFont Ctrl.FontName, Ctrl.FontSize, Ctrl.FontWeight, _
Ctrl.FontItalic, Ctrl.FontUnderline, 0, sCtrlText, 0, lx, ly
If blnRetWidth Then
WizHook_TwipsFromFont = lx
Else
WizHook_TwipsFromFont = ly
End If
End Function
|
|