I have a MapView UI control ( version 14 ) for Windows Forms project from ThinkGeo. I am unable to change the controls background ( or any other property of the control )
The MapView class is reference to WPF component hosted in WindowsForms using .NET8. The WPF support in project properties is enabled. I did not find a way how to access the control properties.
...
...
using ThinkGeo.Core;
using ThinkGeo.UI.WinForms;
...
...
namespace MapApp
{
public partial class Maps : Form
{
private MapView mapView;
...
...
public Maps()
{
InitializeComponent();
this.SuspendLayout();
this.DoubleBuffered = true;
mapView = new ThinkGeo.UI.WinForms.MapView();
mapView.Location = new System.Drawing.Point(0, 0);
mapView.MapResizeMode =
ThinkGeo.Core.MapResizeMode.PreserveScaleAndCenter;
mapView.MaximumScale = 1000000D;
mapView.MinimumScale = 100D;
mapView.Name = "mapView";
mapView.RestrictExtent = null;
mapView.RotatedAngle = 0F;
mapView.Size = new System.Drawing.Size(100, 100);
mapView.TabIndex = 0;
mapView.MapTools.PanZoomBar.IsEnabled = false;
mapView.MapTools.Logo.IsEnabled = false;
//mapView.MapTools.MouseCoordinate.IsEnabled = true;
//mapView.MapTools.ScaleLine.IsEnabled = true;
mapView.Dock = DockStyle.Fill;
mapView.MapUnit = GeographyUnit.Meter;
}
}
...
...
I was trying during the runtime debug and traverse the MapView object. I know I could get the Windows Window handle and traverse the objects and set some properties that way; I'm trying to avoid this as I hope there is a simpler more straight forward way.
The map has a BackgroundOverlay
which has a BackgroundBrush
property.
Give the following code a try:
mapView.BackgroundOverlay.BackgroundBrush = GeoBrushes.White;