10.4 listen to Form Events

Source: Internet
Author: User

Listen to Form Events

To listen to events sent from a form, you can register a listener through the form. For example, to listen to a closing event, register it with the following code:

Mywindow. addeventlistener (event. Closing, onclosingevent );

When an event is triggered, the target attribute referenced by the form sends the event.

Most form events have two types of messages. The first message is that the change of the form is approaching (which can be canceled), and the other message indicates that the change has occurred. For example, when you click the close button, the closing event message is triggered. If no listener cancels the event, the form is closed.

Events related to the Flash. Events. event class:

Activate

Deactivate

Closing

Close

Nativewindowboundsevent:

Use the beforebounds and afterbounds attributes to check whether the form boundary is about to change or has been changed.

Moving

Move

Resizing

Resize

Nativewindowdisplaystateevent:

Use the beforedisplaystate and afterdisplaystate attributes to check whether the form status is about to change or has been changed.

Display_state_changing

Display_state_change

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.