在主窗体中创建菜单
windows窗体中创建唯一值符号化菜单

添加唯一值符号化类(ArcGISClass)
新建UniqueValuesSymbol类 类型是Base Command

在类中的public override void OnClick()函数添加启动符号化窗口代码
完整代码如下:
using System;
using System.Drawing;
using System.Runtime.InteropServices;
using ESRI.ArcGIS.ADF.BaseClasses;
using ESRI.ArcGIS.ADF.CATIDs;
using ESRI.ArcGIS.Controls;
namespace Visualization
{
/// <summary>
/// Command that works in ArcMap/Map/PageLayout
/// </summary>
[Guid("d69af886-1d43-49e8-9242-e24440940e8d")]
[ClassInterface(ClassInterfaceType.None)]
[ProgId("Visualization.UniqueValuesSymbolCmd")]
public sealed class UniqueValuesSymbolCmd : BaseCommand
{
#region COM Registration Function(s)
[ComRegisterFunction()]
[ComVisible(false)]
static void RegisterFunction(Type registerType)
{
// Required for ArcGIS Component Category Registrar support
ArcGISCategoryRegistration(registerType);
//
// TODO: Add any COM registration code here
//
}
[ComUnregisterFunction()]
[ComVisible(false)]
static void UnregisterFunction(Type registerType)
{
// Required for ArcGIS Component Category Registrar support
ArcGISCategoryUnregistration(registerType);
//
// TODO: Add any COM unregistration code here
//
}
#region ArcGIS Component Category Registrar generated code
/// <summary>
/// Required method for ArcGIS Component Category registration -
/// Do not modify the contents of this method with the code editor.
/// </summary>
private static void ArcGISCategoryRegistration(Type registerType)
{
string regKey = string.Format("HKEY_CLASSES_ROOT\\CLSID\\{
{
{0}}}", registerType.GUID);
MxCommands.Register(regKey);
ControlsCommands.Register(regKey);
}
/// <summary>
/// Required method for ArcGIS Component Category unregistration -
/// Do not modify the contents of this method with the code editor.
/// </summary>
private static void ArcGISCategoryUnregistration(Type registerType)
{
string regKey = string.Format("HKEY_CLASSES_ROOT\\CLSID\\{
{
{0}}}", registerType.GUID);
MxCommands.Unregister(regKey);
ControlsCommands.Unregister(regKey);
}
#endregion
#endregion
private IHookHelper m_hookHelper = null;
public UniqueValuesSymbolCmd()
{
base.m_category = "Visualization";
base.m_caption = "唯一值符号化";
base.m_message = "唯一值符号化";
base.m_toolTip = "唯一值符号化";
base.m_name = "UniqueValuesSymbolCmd";
try
{
string bitmapResourceName = GetType().Name + ".bmp";
base.m_bitmap = new Bitmap(GetType(), bitmapResourceName);
}
catch (Exception ex)
{
System.Diagnostics.Trace.WriteLine(ex.Mess

最低0.47元/天 解锁文章
1万+





