Forum Discussion

NisHera's avatar
NisHera
Valued Contributor
9 years ago

Referring of user-forms

I have several projects for testing.
One project entirly consists of re-useble libraries
Wrote a user-form and event script in library project, which supposed to used in several projects.
But when you add those as unit reference to projects, only one instance will work fine.
Other will get error

 

Unable to execute the "OnShow" event of the "Root_0AA8315E_7F1E_44C7_9CC8_9A3C7AF4B163" object.
The "CurruntTest_OnShow" method cannot be found or it has an invalid number of parameters.

Think this is b'cos all instance of the form could reffer only one instance of event script
Any ideads?

3 Replies

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi NisHera,

     

    There is no way to add an existing GeneralEvents item to a project. Each event should be created manually. Thus, you can add all your script units, event handlers, etc. to the second project and try to generate events in this project. Does it work?

    • NisHera's avatar
      NisHera
      Valued Contributor

      Hi,

      This is not about Genaral Events but user-form specific events.

      I add the form and event handling script as unit reference to 2nd project. 

      Problem is the form in project 1 and form in Project 2 points to same event handler script.

      If I change event handling script of the form in project 2, same will happens in form in project 1(I think by reference).

      So the project 2 works not project 1 and viceversa