Creating a custom tool in MapXtreme.Net

Products Affected: MapXtreme.NET
C# Code:
Hide details for Page LoadPage Load
// TODO: Add any constructor code after InitializeComponent call
//Set another cursor other than the default
MapInfo.Tools.IMouseToolProperties mp = mapControl1.Tools.MouseToolProperties;
mp.Cursor = new System.Windows.Forms.Cursor(@"C:\Program Files\Common Files\MapInfo\MapXtreme\X.0\WebResources\MapInfoWebRectangleSelection.cur");
MapInfo.Tools.CustomRectangleMapTool BoundsTool = new MapInfo.Tools.CustomRectangleMapTool
(false,true,true,mapControl1.Tools.FeatureViewer,mapControl1.Handle.ToInt32(),mapControl1.Tools,mp,mapControl1.Tools.MapToolProperties);
//Add the new tool to the control
mapControl1.Tools.Add("Bounds", BoundsTool);
//Add the handler to process the tool
this.mapControl1.Tools.Used += new MapInfo.Tools.ToolUsedEventHandler(Tools_Used); 

Hide details for Tool Used EventTool Used Event
MapInfo.Geometry.DPoint ptMouseDown; 
private void Tools_Used(object sender, MapInfo.Tools.ToolUsedEventArgs e)
{
switch (e.ToolName.ToString())
{
case "Bounds":
switch (e.ToolStatus)
{
case MapInfo.Tools.ToolStatus.Start:
ptMouseDown = e.MapCoordinate;
break;
case MapInfo.Tools.ToolStatus.End:
MapInfo.Geometry.DRect Rect = new MapInfo.Geometry.DRect(ptMouseDown, 
e.MapCoordinate);
mapControl1.Map.Bounds = Rect;
break;
}
break;
}
}
UPDATED:  September 13, 2019