ArcGIS鼠标滚轮方向之代码篇

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

/// <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\Settingsstring

相关文章
相关标签/搜索