首页 > 其他 > 详细

ArcGIS鼠标滚轮方向之代码篇

时间:2019-04-18 10:17:18      阅读:126      评论:0      收藏:0      [点我收藏+]

Desktop10.X有多个版本,不同版本的注册表路径不一致,注册表中可能残留多个版本的注册信息;也可能没有Desktop,而是Engine。其实可以通过RuntimeManager.ActiveRuntime的属性开判断版本、产品类型、甚至安装路径等。

/// <summary>
/// 修改滚轮方向
/// </summary>
/// <param name="flag">0:向前表示放大(常规习惯);1:向前表示缩小</param>
public static void ModifyWheel(int flag = 0)
{
    string path = @"Software\ESRI\" + RuntimeManager.ActiveRuntime.Product + RuntimeManager.ActiveRuntime.Version + @"\ArcMap\Settings" ;
    RegistryKey setKey = Registry.CurrentUser.OpenSubKey(path, true) ?? Registry.CurrentUser.CreateSubKey(path);
    setKey?.SetValue("ReverseMouseWheel", flag, RegistryValueKind.DWord);
}

  

如果绑定ProductCode.Engine许可,路径为\Software\ESRI\Engine10.2\ArcMap\Settings;如果绑定ProductCode.Desktop许可,路径为\Software\ESRI\ Desktop10.2\ArcMap\Settings

技术分享图片

ArcGIS鼠标滚轮方向之代码篇

原文:https://www.cnblogs.com/liweis/p/10727496.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!