private void tspDrawLine_Click(object sender, EventArgs e) { HookHelper mHook = HookHelper.Instance(); ICommand pCmd = new DrawPolylineTool(); pCmd.OnCreate(mHook); mHook.MapControl.CurrentTool = pCmd as ITool; }
private void button1_Click(object sender, EventArgs e) { float dx, dy; Graphics g = this.CreateGraphics(); try { dx = g.DpiX; dy = g.DpiY; } finally { g.Dispose(); } MessageBox.Show(string.Format("{0}/{1}", dx, dy)); HookHelper mHook = HookHelper.Instance(); ICommand pCmd = new DrawPolylineTool(); pCmd.OnCreate(mHook); mHook.MapControl.CurrentTool = pCmd as ITool; }