TextWinTextColor Example

Using Programming Languages other than VBA

Sub Example_TextWinTextColor()
	' This example returns the current setting of
	' TextWinTextColor. It then changes the value, and finally
	' it resets the value back to the original setting.

	Dim preferences As AcadPreferences
	Dim currTextWinTextColor As Long

	Set preferences = ThisDrawing.Application.preferences

	' Retrieve the current TextWinTextColor value
	currTextWinTextColor = preferences.DISPLAY.TextWinTextColor
	MsgBox "The current value for TextWinTextColor is " _
			& preferences.DISPLAY.TextWinTextColor, vbInformation, "TextWinTextColor Example"

	' Change the value for TextWinTextColor
	preferences.DISPLAY.TextWinTextColor = vbGreen
	MsgBox "The new value for TextWinTextColor is " _
			& preferences.DISPLAY.TextWinTextColor, vbInformation, "TextWinTextColor Example"

	' Reset TextWinTextColor to its original value
	preferences.DISPLAY.TextWinTextColor = currTextWinTextColor
	MsgBox "The TextWinTextColor value is reset to " _
			& preferences.DISPLAY.TextWinTextColor, vbInformation, "TextWinTextColor Example"
End Sub

 

   Comments?