I am trying to capture the event when a user goes to the Sales Transsction entry screen, clicks on Actions and then Tranasfer. I want to capture the event of clicking on transfer. I have this set of code but what happens is the message in this code pops up when the SOP screen opens or jst about any other clicks on the screen. I only want to capture the even when Transfer is clicked. How should this code be changed?
/* Register a click event for the Actions->Transfer click */ try { sopEntryForm.SopEntry.ActionButton.Change += new EventHandler(ActionButton_Change); } catch (Exception ex) { string eMsg = "004: ERROR: " + ex.Message; if (stackTraceWanted) eMsg += "\n" + ex.StackTrace; MessageBox.Show(eMsg); }
/* Method to handle Action Button change event */ private void ActionButton_Change(object sender, EventArgs e) { switch (sopEntryForm.SopEntry.ActionButton.Value) { case 0: MessageBox.Show("I clicked Transfer"); break;
case 1: MessageBox.Show("I clicked something else"); break;
default: MessageBox.Show("I think, therefore I am! " + sopEntryForm.SopEntry.ActionButton.Value.ToString()); break; } }
*This post is locked for comments