CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2009
    Posts
    2

    how to raise event in multiple forms... form1 to form 2

    Hello,

    Hello i have form 1 which will raise an event for form2 after doing some calculations....

    My question is: i know how to raise an event in form2 and then write the sub in form1 but i cannot do the reverse... how can i do this in reverse???

    i cannot raise the event sub in form2 is not responding..... how can i overcome this??

    Example:

    form1:

    Code:
    Public Class Form1
    
    Event test()
    
    .
    .
    .
    RaiseEvent test()
    .
    .
    .
    End Class

    form2:

    Code:
    Public Class Form2
    
    Dim WithEvents f As New Form1()
    
    Private Sub f_test() Handles f.test
    
            msgbox("HELLO WORLD")
    
        End Sub
    
    End Class
    it is not working....

    Pls Help
    Last edited by HanneSThEGreaT; October 28th, 2009 at 12:59 AM.

  2. #2
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,284

    Re: how to raise event in multiple forms... form1 to form 2

    Why not make it a Public sub, in a module for instance ¿

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

Featured