1 Reply Latest reply: Oct 16, 2001 12:00 AM by RSS

    Using VB scriptable objects

      Does anyone know of any good tutorials on using scriptable objects.

      I've had a dabble but need to learn more; e.g. how do you make a command button work when you click on it?

      Mine only seem to run the script after you click outside the region that contains the button.

      Is it possible to create an input form in visual basic and show that by clicking the command button on the mathcad sheet?


        • Using VB scriptable objects
          To make the Scriptable Object Component (SOC) do something when an event is fired by the embedded control you need to write an event handler (in the SOC script).

          For example, here is some code from one of our custom controls

          Sub PushBtn_Click()
          If state = 0 Then
          state = 1
          state = 0
          End If
          End Sub

          When you click on the pushbutton control the Click event will be raised and this routine will be called. It changes the state of a global variable and causes the SOC to recalculate.

          Of course, I can't go into all of the details here but every control that can be embedded in a SOC will most likely fire an event...so you need to write the code to handle the event.

          Check out some of the other custom control scripts and search the collab for "scriptable" for more examples.

          I hope this helps.