Customize Widget Event Code

You can customize widget event code in the Device Application Designer. Define the widget event in control's Actions|Coding tab.

After code generation, a widget event handler method is generated in the controller class. For example:

// button (Button Events) click event handler
      internal virtual void ButtonEventsButton_ClickHandler(FormsManagerDataObject dataObject)
      {
         // actions
         try
         {
      	}
      	catch (Exception __ex__)
          {
             if (__ex__.InnerException != null)
             {
                 MessageBox.Show(__ex__.Message + " [" + __ex__.InnerException.Message + "]", "Error", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Exclamation, System.Windows.Forms.MessageBoxDefaultButton.Button1);
             }
             else
             {
                 MessageBox.Show(__ex__.Message, "Error", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Exclamation, System.Windows.Forms.MessageBoxDefaultButton.Button1);
             }
             Sybase.UnwiredPlatform.Windows.Util.Logger.Instance.Log(__ex__);
          }
      }
You can add your action code in this method or define the action code in a partial class so your code will not be overridden during the next generation. For example:
/// <summary>
   /// The Controller class of Form FormCreateCustomerController
   /// </summary>
   internal partial class FormCreateCustomerController
   {
      internal override void ButtonEventsButton_ClickHandler(FormsManagerDataObject dataObject)
      {
         // Add your event handler code here

         // Call base method
         base.ButtonEventsButton_ClickHandler(dataObject);
      }
   }