ArcGIS API for WPF - Library Reference
TextColor Property
See Also  Example Send comments on this topic
ESRI.ArcGIS.Client Namespace > ScaleBar Class : TextColor Property

Note: This API is now obsolete. Please use the ScaleLine control in the ESRI.ArcGIS.Client.Toolkit namespace.

Gets or sets the color of the text that is displayed on the ScaleBar Control to denote the current scale.

Syntax

Visual Basic (Declaration) 
Public Property TextColor As Brush
C# 
public Brush TextColor {get; set;}

Example

XAMLCopy Code
<esri:ScaleBar Name="ScaleBar1" Map="{Binding ElementName=Map1}"
              MapUnit="DecimalDegrees" DisplayUnit="Miles"  
              TextColor="Black" FontFamily="Courier New" FontSize="18" />
C#Copy Code
//Using the existing ScaleBar1 Control that was defined previously
	
//Bind to a Map Control
ScaleBar1.Map = Map1;
            
//Set the Map and Display units for the ScaleBar
ScaleBar1.MapUnit = ESRI.ArcGIS.Client.ScaleBarUnit.DecimalDegrees;
ScaleBar1.DisplayUnit = ESRI.ArcGIS.Client.ScaleBarUnit.Miles;
            
//Set TextColor and related Font information
System.Windows.Media.Color myTextColor = Color.FromArgb(255, 0, 0, 0); //Black
ScaleBar1.TextColor = new System.Windows.Media.SolidColorBrush(myTextColor);
ScaleBar1.FontFamily = new FontFamily("Courier New");
ScaleBar1.FontSize = 18;
VB.NETCopy Code
Using the existing ScaleBar1 Control that was defined previously
               
'Bind to a Map Control
ScaleBar1.Map = Map1
            
'Set the Map and Display units for the ScaleBar
ScaleBar1.MapUnit = ESRI.ArcGIS.Client.ScaleBarUnit.DecimalDegrees
ScaleBar1.DisplayUnit = ESRI.ArcGIS.Client.ScaleBarUnit.Miles
            
'Set TextColor and related Font information
Dim myTextColor As System.Windows.Media.Color = Color.FromArgb(255, 0, 0, 0) 'Black
ScaleBar1.TextColor = New System.Windows.Media.SolidColorBrush(myTextColor)
ScaleBar1.FontFamily = New FontFamily("Courier New")
ScaleBar1.FontSize = 18

Remarks

The following image depicts what part of the ScaleBar is impacted by the TextColor Property:

The TextColor Property is set to Black.

TextColor considerations:

The default TextColor is White.

If the ScaleBar Control is sitting on an area of the SilverLight/WPF application where the background is also White, it will appear that no text is displayed. Change the TextColor to a color that contrasts with the background Silverlight/WPF application where the ScaleBar sits and the text will be revealed.

Requirements

Target Platforms: Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© ESRI, Inc. All Rights Reserved.