title: How to Execute an external link - VB 2008
body: <p>I am new to Visual Basic, I want to program multiple buttons, the buttons have similar functions, and wanted to add to each button the same script, but it will give many lines for each button, so how is the same script, I want to be able to make an external link as ".VB" that communicates with the base program link ...
    Eg:</p>
  
  <p>(Code of the Main Window) "JoVen.vb"</p>
  
  <pre><code>Public Sub Button1_Click (ByVal sender As System.Object, ByVal e As
      'Code to send run External link Ai.vb
  End Sub
  
  Public Sub Button2_Click (ByVal sender As System.Object, ByVal e As
      'Code to send run External link Ai.vb
  End Sub
  </code></pre>
  
  <p>(Code External VB Script) "AI.vb"</p>
  
  <pre><code>Public Class AI
      Public Sub Main ()
           Dim But1 The New Jove ()
           But1.Bt1 = True
           MsgBox ("Link Executed")
      end Sub
  end Class
  </code></pre>
  
  <p>I hope you understand me, sorry if I wrote something wrong, I'm using Google Translator.</p>