I’ve been working with the Bing Maps map control for WPF recently and doing some fascinating geo-location UI that I can’t imagine doing with any other technology. A couple of days ago a colleague of mine asked me how to place some text on a WPF Bing Maps map. Amazingly, even though I’d done all kinds of sophisticated arcs and other UI, I’d never had the need to simply place some text on a WPF map. After some experimentation, here is one simple approach I came up with:
static void PlaceText(Map map, string text, Location location,
Color fontColor, double fontSize)
{
System.Windows.Controls.Label label =
new System.Windows.Controls.Label();
label.Content = text;
label.Foreground = new SolidColorBrush(fontColor);
label.FontSize = fontSize;
MapLayer.SetPosition(label, location);
map.Children.Add(label);
return;
}
Essentially the idea is to just programmatically place a Label control onto the map. Calling this helper method onto a WPF Bing Maps map control named ‘myMap’ could resemble:
Location textLocation = myMap.Center; string text = "Some short text"; PlaceText(myMap, text, textLocation, Colors.Yellow, 25.0);
Instead of a Label control, if you need a bit more flexibility, you can use a TextBlock control:
System.Windows.Controls.TextBlock tb = new System.Windows.Controls.TextBlock(); tb.Text = text; tb.Foreground = new SolidColorBrush(fontColor); tb.FontSize = fontSize; MapLayer.SetPosition(tb, location); map.Children.Add(tb);
When WPF was first released I wasn’t too impressed, but the Bing Maps map control for WPF is the killer app for me. I’ve tried lots of geo-location UI tools and technologies, but the Bing Maps WPF map control is by far the best I’ve used. The combination of WPF and Bing Maps is one of my favorite technologies.

.NET Test Automation Recipes
Software Testing
SciPy Programming Succinctly
Keras Succinctly
R Programming
2026 Visual Studio Live
2025 Summer MLADS Conference
2026 DevIntersection Conference
2025 Machine Learning Week
2025 Ai4 Conference
2026 G2E Conference
2026 iSC West Conference
You must be logged in to post a comment.