05-02-2012 05:47 AM
Hello,
I had implemented menu in my app sucessfully.
But I am facing one another problem,
When I click on the button menu appears as context menu.(see the below image)
I dont want that menu to be appear while I am clicking on button field.
This menu is appearing when I click on any of the button.
Quit
and show result is the menu that I added in my screen.
in constructor
addMenuItem(_mnu_showresult);
addMenuItem(_mnu_quit);
/*declared menu item*/
private MenuItem _mnu_showresult = new MenuItem(new StringProvider(
"Show Result"), 110, 1) {
public void run() {
Dialog.alert("You had scored ");
}
};
private MenuItem _mnu_quit = new MenuItem(new StringProvider("Quit"), 110, 2) {
public void run() {
}
};
How I can solve the problem?
Thanks in advance.
bskania.
Solved! Go to Solution.
05-02-2012 08:19 AM
Hi,
Use ButtonField.Consume click to avoid that menu.
ButtonField myBtn = new ButtonField("My Button",ButtonField.ConsumeClick);
Regards,
Lakshman K
05-03-2012 06:12 AM
Can I also recommend that you search the forum before you post a question. In this case, if you had searched for "button menu" you would have found other Threads that have reported the same problem and resolved it using ButtonField.CONSUME_CLICK as suggested above.
05-04-2012 02:34 AM