PB Entry-itemchanged (long row,dwobject dwo,string data)

Source: Internet
Author: User
Tags switch case

Daily summary are must, good memory than rotten pen, well, a week did not take notes, recently busy PB, Hey East learn Western learning, the most terrible is the last Dora, spit trough about PB resources Why so little, today recorded is about ItemChanged event introduction.

Description:

The ItemChanged event occurs after the field in the DataWindow has been modified and loses focus, although this event is also triggered before the update function is called, and there are three parameters for the event:

Long row, which indicates when the forward

Dwobject Dwo, representing the field in DataWindow, example dwo.name = "Filedname"

String data, which means that new data, which is just entered

Return Values

0 (default) Receives data and shifts focus to the next line

1 reject input data, and focus does not shift

2 rejects the input of the data, but shifts the focus to the next line, and the data does not change, as before the modification

Precautions

This event is not triggered when the data window itself loses focus.

Sample

   1:  datetime lda_today//PB does not need ";", but in disconnect it needs ";" Difficult to understand
   2:   //  today ()   PB system function, get day date; now ()  PB system function, get time
   3:  lda_today = DateTime (Today (), now ())  
   4:   //  equivalent to switch case but the grammatical similarities need to be noted
   5:  case Dwo.name
   6:   //   field name
   7:  case  "Stu_info_stu_birthdate"
   8:   //For judgment, control date, or input of other data
   9:      if datetime (data) > Lda_today Then
  Ten:          MessageBox ("Error!","date entered cannot exceed current date")
One   :          return 2
  :      if
  :  
  :  case  "Stu_info_stu_enterdate"
  :  
  :      if datetime (data) > Lda_today Then
  :          MessageBox ("Error!","date entered cannot exceed current date")
  :          return 2
  :      if
  :  case"Stu_info_stu_phone"
  :      if len (data) < Then
  :          MessageBox ("Error!","Please enter the correct mobile number")
2   :          return
  :      if
  :  
  :  case  Else
  :  
  :      return 0
  
  :  End Choose

Passing by IS learning Pb, leave a fan bit, learn from each other!!!

PB Entry-itemchanged (long row,dwobject dwo,string data)

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.