1.11M Members

how to create a module

 
0
 

as the title , i want to create module for my application . i found that module is used for global declaration or function / procedure defination.

but here i want to ask that how to create a module in vb.net which is applicable to all the window forms of the application(for ex: i put Dim a As Integer=10 then this a will be applicable to form1 as well as form2 and so on ).
whether i have to create another module file what we do in vb6 OR there is something other way to create it. if possible then please put a very simple syntax or code so that i can understand the concept behind module.

 
0
 

Replace Dim with Public

Your code
Dim a As Integer=10

Make it
Public a As Integer=10

 
0
 

ok.
i replace Dim with pubilc when i will understand how to create a module.

 
0
 

Modules are used(as far as I know) in Visual Basic for Applications, VBA, the macro language used in Excel and Word. Are you referring to that, or do you use something like Visual Studio with VB.NET?

 
0
 

i want to use module in Visual Studio with VB.NET

 
0
 

Follow this Success.
But why not use classes?

 
0
 

i dont know if i get your question right.
You can create module in vb.net by right clicking your application name then click add and click module it then would add something like Module1 in your project.
The other way around is that you can create library classes or dll which i think is much better, you can use it to any application you want. Add Reference - Browse - Select the .dll you have created then Imports it tou your form.

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article