2 Replies Latest reply on Dec 4, 2014 10:42 AM by Mohammed Elkalakhi

    Prevent Property manager page from closing

    Mohammed Elkalakhi

      Hello,

       

      I have developped a property manager page, when I show it and I press return key it closes.

       

      How can I prevent property manager page from closing when I press return key?

       

      Thank you in advance.

        • Re: Prevent Property manager page from closing
          Oleg Bezyaev
          public class PMPHandlerPart: IPropertyManagerPage2Handler8
              {
          public bool OnKeystroke(int Wparam, int Message, int Lparam, int Id)
                  {
                     
                          case (int)Keys.Enter:
                              this.OnClose((int)swPropertyManagerPageCloseReasons_e.swPropertyManagerPageClose_Okay);
                              break;
                          case (int)Keys.Escape:
                              this.OnClose((int)swPropertyManagerPageCloseReasons_e.swPropertyManagerPageClose_Cancel);
                              //swModel.Extension.RunCommand((int)swCommands_e.swCommands_PmCancel, "");
                              break;
                      }
                      //if (Wparam != (int) Keys.Enter)
                      //{
                      //    //Whatever code Enter is supposed to accomplish goes here
                      //    //return false; // Tells SolidWorks that this keystroke should not be handled after this method call
                         
          
          
                      //}
                      return false; // Everyother keypress is not handled by this method, so SolidWorks should still process it.
                  }
          }