设置 IMapControl2.MouseIcon 鼠标样式
In most development evironments the control's property pages can be used to load either a cursor (.cur) or icon (.ico) file. A cursor contains a custom 'hotspot' location and can be any size. The 'hotspot' location for an icon file defaults to the center of the icon. This property cannot be used to load animated cursor (.ani) files.
To programatically create an object implementing IPictureDisp there is the win32 function OleLoadPicture or helper methods depending on the development environment.
When working directly with AxControls class use the MouseIcon property as follows:
axMapControl1.MouseIcon =newIcon("myIcon.ico");
axMapControl1.MousePointer = esriControlsMousePointer.esriPointerCustom;
When using the Controls interop assembly use the MouseIcon property as follows:
IMapControl2 mapControl = (IMapControl2) axMapControl1.Object;
Icon icon =newIcon(GetType().Assembly.GetManifestResourceStream(GetType(), "myIcon.ico"));
mapControl.MouseIcon = (stdole.IPictureDisp) ESRI.ArcGIS.ADF.COMSupport.OLE.GetIPictureDispFromIcon(icon);
mapControl.MousePointer = esriControlsMousePointer.esriPointerCustom;
When working directly with AxControls class use the MouseIcon property as follows:
AxMapControl1.MouseIcon =NewIcon("myIcon.ico")
AxMapControl1.MousePointer = esriControlsMousePointer.esriPointerCustom
When using the Controls interop assembly use the MouseIcon property as follows:
DimmapControlAsIMapControl2 = AxMapControl1.Object
DimmyIconAsIcon =NewIcon(GetType(Form1).Assembly.GetManifestResourceStream(GetType(Form1), "myIcon.ico"))
mapControl.MouseIcon = ESRI.ArcGIS.ADF.COMSupport.OLE.GetIPictureDispFromIcon(myIcon)
mapControl.MousePointer = esriControlsMousePointer.esriPointerCustom

浙公网安备 33010602011771号