on 10-18-2005 6:10 PM
I have an add-on that puts a new button on the Item Master form. Clicking that item brings up a new data entry form. Everything works well except that it appears the click event is firing twice. I have this code to capture the click for the custom button:
If pVal.Before_Action = False And pVal.ItemUID = "btnMxSet" Then
..load my new form
End If
The problem is that the form tries to load twice because the event is fired twice. I added an SBO message box before loading the form and it only fires off once. I suppose I can check to see if the form is loaded, but I want to see why the event fires twice.
Any ideas? If not, what's the best way to check to see if a given form is loaded?
The people on this forum are very helpful!
Thanks.
You should also add a pVal.EventType == BoEventTypes.et_ITEM_PRESSED...
Complete code:
public static bool isButtonClick(string UID) {
return (!pVal.BeforeAction && pVal.ItemUID==UID && pVal.EventType == BoEventTypes.et_ITEM_PRESSED);
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes... Item_Click is fired beforee item_pressed
.... But remember, you should almost all the time use item_pressed and not item_click... You can try to see the difference if you set the event to item_click, left click button but not release the button and move the mouse away from the button.... them try moving the mouse over the button again...
In all my addons I don't think i've used item_click yet
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.