繁体   English   中英

GMAP 控件“.NET 不是‘GMapControl’的成员”

[英]GMAP Control ".NET is not a member of 'GMapControl'"

我在尝试使用 GmapControl package 运行我的应用程序时遇到解决方案错误。删除有错误的行似乎不会以任何方式影响应用程序但允许我运行应用程序,调试一段时间后不久,这些行重新出现在designer.vb 文件并返回错误。

Me.GMap.Bearing = 0!
Me.GMap.CanDragMap = True
Me.GMap.Dock = System.Windows.Forms.DockStyle.Fill
Me.GMap.EmptyTileColor = System.Drawing.Color.Navy
Me.GMap.GrayScaleMode = False
Me.GMap.HelperLineOption = GMap.NET.WindowsForms.HelperLineOptions.DontShow 'Error Line
Me.GMap.LevelsKeepInMemory = 5
Me.GMap.Location = New System.Drawing.Point(3, 3)
Me.GMap.MarkersEnabled = True
Me.GMap.MaxZoom = 2
Me.GMap.MinZoom = 2
Me.GMap.MouseWheelZoomEnabled = True
Me.GMap.MouseWheelZoomType = GMap.NET.MouseWheelZoomType.MousePositionAndCenter 'Error Line
Me.GMap.Name = "GMap"
Me.GMap.NegativeMode = False
Me.GMap.PolygonsEnabled = True
Me.GMap.RetryLoadTile = 0
Me.GMap.RoutesEnabled = True
Me.GMap.ScaleMode = GMap.NET.WindowsForms.ScaleModes.[Integer] 'Error Line
Me.GMap.SelectedAreaFillColor = System.Drawing.Color.FromArgb(CType(CType(33, Byte), Integer), CType(CType(65, Byte), Integer), CType(CType(105, Byte), Integer), CType(CType(225, Byte), Integer))
Me.GMap.ShowTileGridLines = False
Me.GMap.Size = New System.Drawing.Size(658, 455)
Me.GMap.TabIndex = 1
Me.GMap.Zoom = 0R

问题是名称冲突。 GMap是一个命名空间,它是.NET的成员,但您还添加了一个名为GMapControlGMap ,因此编译器将其解释为该名称。 请注意这些行的左侧都有Me.GMap吗? 右侧带有GMap的那些被解释为引用相同的GMapControl而不是适当的名称空间。 如果更改控件的名称,则问题将 go 消失。

您可能需要先删除这些行或之后手动编辑它们,因为重命名也可能会更改命名空间的名称。

这是为什么对您的控件和其他名称进行一些思考很重要的示例。 如果您使用的名称在您的特定场景中具有描述性,则名称冲突的可能性较小。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM