Results 1 to 3 of 3

Thread: Calling Private Function

  1. #1

    Thread Starter
    Addicted Member wolfofthenorth's Avatar
    Join Date
    Jan 2001
    Location
    Tatooine
    Posts
    169
    You can put any functions you want both forms to access in a module.

    You can create a class that both forms can access.

    You can declare a public function in form B. Set a reference to form B in form A. Then access the function through the reference.

    I think either of the first two ideas are better than the third.


    Hope this helps.
    That which does not kill us, only makes us stronger.

  2. #2
    Junior Member
    Join Date
    Apr 2002
    Posts
    18
    Thanks, and I like the method 3....

    But how to get it done? Can you show me with some sample code?

    Thanks a lot

    Andy

  3. #3

    Thread Starter
    Addicted Member wolfofthenorth's Avatar
    Join Date
    Jan 2001
    Location
    Tatooine
    Posts
    169
    Try this.

    Inside Form2---

    Public Sub MySub()
    'Some code here
    End Sub



    Inside Form1----

    Dim Frm as new Form2

    Frm.MySub
    That which does not kill us, only makes us stronger.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width