protected override void OnClick()
 {
     if (Enabled)
     {
         try
         {
             using (var form = new StraightLineForm())
             {
                 form.ShowDialog();
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show(GetType() + " encountered a problem.\n\n" + ex,
                             "Unhandled Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }
 private void btnStraightLineTool_Click(object sender, EventArgs e)
 {
     using (StraightLineForm form = new StraightLineForm())
     {
         form.ShowDialog();
     }
 }
        /// <summary>
        /// Occurs when this command is clicked
        /// </summary>
        public override void OnClick()
        {
            NPSGlobal NPS;

            NPS = NPSGlobal.Instance;

            //make sure the NPS objects were all init okay
            if (string.IsNullOrEmpty(NPS.InitErrorMessage) == false)
            {
                System.Windows.Forms.MessageBox.Show(NPS.InitErrorMessage);
                return;
            }

            //show straightline form
            using (StraightLineForm form = new StraightLineForm())
            {
                form.ShowDialog();
            }
        }