Friday, April 29, 2011

How to Use Form Method -- Task()


Hi,
Task() - The user performs some task in a form by using the toolbar, the menu, or the keyboard.
For Example Here I am Closing the Form by pressing TAB
Steps:
1. Create a Form Ex: Test Form
2. In Design node Take string Edit Control.
3. Create Task() method in Form Methods.
4. Set the Debug Mode on Task() method. Using this debug you can find Keyboard ID (like here we are doing through TAB)
5.Then Press F5.
6.Enter some text in String Edit control.
7.It will take to you  on Debug Mode.Here (ret = super(_taskId);) you will get the Task ID.
8.Then you can write the Code..
=========================
public int task(int _taskId)
{
int ret;

ret = super(_taskId);// task Id will get keys ID value
if(_taskId == 2827)//2827 is the TAB ID
element.close();

return ret;
}

=========================

4 comments:

  1. Thanks! Worked perfectly.

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. does it work with barcode scanner? i need to scan barcode to strinEdit field on form, and get some code with that stringEdit.text(). Will it work with task method?

    ReplyDelete
  4. Thanks,
    element.task(2876); you can write this line of code in form insted of pressing F5.

    ReplyDelete

Leave your comments and solutins