Button Script Sample Code

The following example shows code for a button object called MyExpert that gets the timer or event object, the event trigger name, and picture name, if any, from the Add Event dialog box. It passes this information in to the form using the GetCurrentObjectValues procedure, and then displays the form.

Private Sub MyExpert_Click()

 

     Dim CurrentObj As Object

     Dim EventName As String

 

     'Set procedure object, event name, and file name

     Set CurrentObj = MyExpert.ProcedureObject

     EventName = MyExpert.EventProcedure

     MyExpert.Property1 = frmOpenPicture.TextBox1.Value

 

     'Pass the object and event name into the form

     Call frmOpenPicture.GetCurrentObjectValues(CurrentObj,_

     EventName)

     frmOpenPicture.Show

     frmOpenPicture.Hide

End Sub