Free Source Code and Tutorials

Custom Search


A module is quite similar to a class but every module has exactly one instance and it does not need to be assigned to a variable and does not support an inheritance.


A module last a lifetime same as your program because all of its members are Shared. Modules access levels can be adjusted with the access modifier.



  • Open the Visual Basic, select “File” on the menu, hit new and create a new project.
  • The New Project dialog will appear.
    Select “windows” in the project types, hit the “windows form application” in the templates and hit “ok“.
  • Go to the solution explorer. Right click the application, click add and select a Module.
  • The add new Item dialog will appear and do the process like what is shown below.
  • Add the following code in the Module1
  1. Module Module1
  2. Public Sub popUpMsg(ByVal msg As String)
  3. MsgBox(msg)
  4. End Sub
  6. End Module
  • Design the form just like shown below.
  • Go to the form design and double click a button to fire the click event handlerof it. Add this following code in the method.
  1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  2. popUpMsg("Hello World")
  3. End Sub




Facebook Comments
(Visited 14 times, 1 visits today)
Share this

Check Your Domain Ranking

Leave a Reply

Your email address will not be published. Required fields are marked * © 2016 Frontier Theme

Subscribe For Latest Updates

Signup for our newsletter and get notified when we publish new articles for free!

%d bloggers like this: