F
fzkdhxd
Unregistered / Unconfirmed
GUEST, unregistred user!
在VB中的事件可以自已定义,在DELPHI中如何来引用,谢谢各位大虾们:<br>//VB源代码:<br>Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, pVal As SAPbouiCOM.IItemEvent, BubbleEvent As Boolean)<br> <br> '//*************************************************************************<br> '// BubbleEvent sets the behavior of SAP Business One.<br> '// False means that the application will not continue processing this event.<br> '//*************************************************************************<br> <br> If pVal.FormType <> 0 Then<br> <br> '//************************************************************<br> '// the message box form type is 0<br> '// I chose not to deal with events triggered by a message box<br> '//************************************************************<br> <br> Select Case pVal.EventType<br> <br> '//************************************************************<br> '// every event will open a message box with the event<br> '// name and the form UID how sent it<br> '//************************************************************<br> <br> Case et_ITEM_PRESSED:<br> <br> '// Specifies a button release (After exit).<br> <br> SBO_Application.MessageBox _<br> "An et_ITEM_PRESSED has been sent by a form with the unique ID: " + FormUID<br> <br> Case et_KEY_DOWN:<br> <br> '// Specifies a key down event.<br> <br> SBO_Application.MessageBox _<br> "An et_KEY_DOWN has been sent by a form with the unique ID: " + FormUID<br> <br> Case et_GOT_FOCUS:<br> <br> '// Specifies an item got focus.<br> <br> SBO_Application.MessageBox _<br> "An et_GOT_FOCUS has been sent by a form with the unique ID: " + FormUID<br> <br> Case et_LOST_FOCUS:<br> <br> '// Specifies an item lost focus.<br> <br> SBO_Application.MessageBox _<br> "An et_LOST_FOCUS has been sent by a form with the unique ID: " + FormUID<br> <br> Case et_COMBO_SELECT:<br> <br> '// Specifies the selection of valid value in Combo Box.<br> <br> SBO_Application.MessageBox _<br> "An et_COMBO_SELECT has been sent by a form with the unique ID: " + FormUID<br> <br> Case et_CLICK:<br> '// Specifies Mouse Up on editable item.<br> <br> SBO_Application.MessageBox _<br> "An et_CLICK has been sent by a form with the unique ID: " + FormUID<br> <br> Case et_DOUBLE_CLICK:<br> '// Specifies Mouse Up on editable item in time interval define by<br> '// SAP Business One as double-click.<br> <br> SBO_Application.MessageBox _<br> "An et_DOUBLE_CLICK has been sent by a form with the unique ID: " + FormUID<br> <br> Case et_MATRIX_LINK_PRESSED:<br> '// Specifies a link arrow within a matrix was pressed.<br> <br> SBO_Application.MessageBox _<br> "An et_MATRIX_LINK_PRESSED has been sent by a form with the unique ID: " + FormUID<br> <br> Case et_MATRIX_COLLAPSE_PRESSED:<br> '// Specifies collapsed or expanded list within a matrix.<br> <br> SBO_Application.MessageBox _<br> "An et_MATRIX_COLLAPSE_PRESSED has been sent by a form with the unique ID: " + FormUID<br> <br> Case et_VALIDATE:<br> '//Specifies an item validation event.<br> <br> SBO_Application.MessageBox _<br> "An et_VALIDATE has been sent by a form with the unique ID: " + FormUID<br> <br> Case et_FORM_LOAD:<br> '// Specifies that SAP Business One application opened a form.<br> <br> SBO_Application.MessageBox _<br> "An et_FORM_LOAD has been sent by a form with the unique ID: " + FormUID<br> <br> Case et_FORM_UNLOAD:<br> '// Specifies that SAP Business One application closed a form.<br> <br> SBO_Application.MessageBox _<br> "An et_FORM_UNLOAD has been sent by a form with the unique ID: " + FormUID<br> <br> Case et_FORM_ACTIVATE:<br> '// Specifies that the focus is set on the form.<br> <br> Case et_FORM_DEACTIVATE:<br> '// Specifies that the form lost focus.<br> <br> Case et_FORM_CLOSE:<br> '// Specifies that the form was closed by calling the Close event.<br> <br> SBO_Application.MessageBox _<br> "An et_FORM_CLOSE has been sent by a form with the unique ID: " + FormUID<br> <br> Case et_FORM_RESIZE:<br> '// Specifies resizing of the form.<br> <br> SBO_Application.MessageBox _<br> "An et_FORM_RESIZE has been sent by a form with the unique ID: " + FormUID<br> <br> Case et_FORM_KEY_DOWN:<br> '// Specifies a key press on an area which is not item of the form.<br> <br> SBO_Application.MessageBox _<br> "An et_FORM_KEY_DOWN has been sent by a form with the unique ID: " + FormUID<br> <br> End Select<br> End If<br>End Sub<br>该事件如果要在DELPHI中实现,该如何触发?