|
TextFontStyle Пример |
Sub Example_TextFontStyle()
'Этот пример возвращает текущую установку TextFontStyle. Затем изменяет значение
' и наконец сбрасывает значение назад к оригинальной установке.
Dim preferences As AcadPreferences
Dim currTextFontStyle As Integer
Dim constant As String
Dim newConstant As String
Set preferences = ThisDrawing.Application.preferences
'Получите текущее значение TextFontStyle
currTextFontStyle = preferences.DISPLAY.TextFontStyle
constant = Choose(currTextFontStyle + 1, "acFontRegular", "acFontItalic", "acFontBold", "acFontBoldItalic")
MsgBox "Текущее значение для TextFontStyle " & constant, vbInformation, "TextFontStyle Пример"
'Измените значение для TextFontStyle
newConstant = "acFontBoldItalic"
preferences.DISPLAY.TextFontStyle = acFontBoldItalic
MsgBox "Новое значение для TextFontStyle " & newConstant, vbInformation, "TextFontStyle Пример"
'Сбросьте TextFontStyle к его оригинальному значению
preferences.DISPLAY.TextFontStyle = currTextFontStyle
MsgBox "Значение TextFontStyle сброшено к " & constant, vbInformation, "TextFontStyle Пример"
End Sub